Making WordPress.org


Ignore:
Timestamp:
04/11/2017 06:37:04 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Introduce the 'new' post_status to replace 'draft', this will allow a better more well-defined statuses for plugins.

See #2716

File:
1 edited

Legend:

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

    r5316 r5318  
    284284        ) );
    285285
     286        register_post_status( 'new', array(
     287            'label'                     => _x( 'Pending Initial Review', 'plugin status', 'wporg-plugins' ),
     288            'public'                    => false,
     289            'show_in_admin_status_list' => current_user_can( 'plugin_review' ),
     290            'label_count'               => _n_noop( 'Pending Initial Review <span class="count">(%s)</span>', 'Pending Initial Review <span class="count">(%s)</span>', 'wporg-plugins' ),
     291        ) );
    286292        register_post_status( 'pending', array(
    287293            'label'                     => _x( 'Pending', 'plugin status', 'wporg-plugins' ),
     
    793799        if ( $viewing_own_author_archive || ( is_user_logged_in() && !empty( $wp_query->query_vars['name'] ) ) ) {
    794800
    795             $wp_query->query_vars['post_status'] = array( 'pending', 'approved', 'publish', 'closed', 'disabled' );
     801            $wp_query->query_vars['post_status'] = array( 'approved', 'publish', 'closed', 'disabled' );
    796802
    797803            add_filter( 'posts_results', function( $posts, $this_wp_query ) use( $wp_query ) {
     
    11931199                'post_type'   => 'plugin',
    11941200                'name'        => $plugin_slug,
    1195                 'post_status' => array( 'publish', 'pending', 'disabled', 'closed', 'draft', 'approved' ),
     1201                'post_status' => array( 'publish', 'pending', 'disabled', 'closed', 'new', 'draft', 'approved' ),
    11961202            ) );
    11971203
Note: See TracChangeset for help on using the changeset viewer.