WordPress.org

Making WordPress.org

Changeset 3036


Ignore:
Timestamp:
04/28/2016 06:01:20 PM (3 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.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
5 edited

Legend:

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

    r2994 r3036  
    167167
    168168        if ( empty( $query->query['post_status'] ) ) {
    169             $query->query_vars['post_status'] = array( 'publish', 'future', 'draft', 'pending', 'disabled', 'closed', 'rejected' );
     169            $query->query_vars['post_status'] = array( 'publish', 'future', 'draft', 'pending', 'disabled', 'closed', 'rejected', 'approved' );
    170170        }
    171171
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php

    r3034 r3036  
    2525     */
    2626    private function __construct() {
    27         add_action( 'publish_plugin', array( $this, 'publish' ), 10, 2 );
     27        add_action( 'approved_plugin', array( $this, 'approved' ), 10, 2 );
    2828        add_action( 'rejected_plugin', array( $this, 'rejected' ), 10, 2 );
    2929    }
     
    6666
    6767    /**
    68      * Fires when a post is transitioned to 'publish'.
     68     * Fires when a post is transitioned to 'approved'.
    6969     *
    7070     * @param int      $post_id Post ID.
    7171     * @param \WP_Post $post    Post object.
    7272     */
    73     public function publish( $post_id, $post ) {
     73    public function approved( $post_id, $post ) {
    7474        $attachments = get_attached_media( 'application/zip', $post_id );
    7575
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-controls.php

    r2996 r3036  
    4444        if ( current_user_can( 'plugin_approve', $post ) ) {
    4545            if ( in_array( $post->post_status, array( 'draft', 'pending', 'rejected' ) ) ) {
    46                 $statuses = array_merge( $statuses, array( 'publish', 'rejected' ) );
     46                $statuses = array_merge( $statuses, array( 'approved', 'rejected' ) );
    4747            } else {
    4848                $statuses = array( 'publish', 'disabled', 'closed' );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-plugin-tags.php

    r2994 r3036  
    99class Plugin_Tags {
    1010    /**
    11      * Displays the Publish metabox for plugins.
     11     * Displays the Tags metabox for plugins.
    1212     * The HTML here matches what Core uses.
    1313     *
  • 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.