Making WordPress.org


Ignore:
Timestamp:
04/28/2016 06:01:20 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Introduce an approved post status.

Approving a plugin creates the SVN repo and commits the approved plugin files
to that repo. It also add the plugin author to the list of authorised
committers and sends out a congratulatory email.

A plugin will require an initial SVN commit by the post author to then be moved
to publish, making it visible in the directory.

See https://wordpress.slack.com/archives/meta/p1461805883000448
See #1570.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r3034 r3036  
    146146            'label_count'               => _n_noop( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', 'wporg-plugins' ),
    147147        ) );
     148        register_post_status( 'approved', array(
     149            'label'                     => _x( 'Approved', 'plugin status', 'wporg-plugins' ),
     150            'public'                    => false,
     151            'show_in_admin_status_list' => current_user_can( 'plugin_approve' ),
     152            'label_count'               => _n_noop( 'Approved <span class="count">(%s)</span>', 'Approved <span class="count">(%s)</span>', 'wporg-plugins' ),
     153        ) );
    148154        register_post_status( 'closed', array(
    149155            'label'                     => _x( 'Closed', 'plugin status', 'wporg-plugins' ),
     
    435441     * @param int               $object_id Object ID.
    436442     * @param string            $meta_key  Meta key.
     443     * @return array
    437444     */
    438445    public function filter_shim_postmeta( $value, $object_id, $meta_key ) {
     
    442449                $count = Template::get_downloads_count( $post );
    443450
    444                 return array( $count );             
     451                return array( $count );
    445452                break;
    446453            case 'rating':
     
    514521            'post_type'   => 'plugin',
    515522            'name'        => $plugin_slug,
    516             'post_status' => array( 'publish', 'pending', 'disabled', 'closed', 'draft' ),
     523            'post_status' => array( 'publish', 'pending', 'disabled', 'closed', 'draft', 'approved' ),
    517524        ) );
    518525        if ( ! $posts ) {
     
    543550        $title   = ! empty( $plugin_info['title'] )       ? $plugin_info['title']       : '';
    544551        $slug    = ! empty( $plugin_info['slug'] )        ? $plugin_info['slug']        : sanitize_title( $title );
    545         $status  = ! empty( $plugin_info['status'] )      ? $plugin_info['status']      : 'pending';
     552        $status  = ! empty( $plugin_info['status'] )      ? $plugin_info['status']      : 'draft';
    546553        $author  = ! empty( $plugin_info['author'] )      ? $plugin_info['author']      : 0;
    547554        $desc    = ! empty( $plugin_info['description'] ) ? $plugin_info['description'] : '';
Note: See TracChangeset for help on using the changeset viewer.