WordPress.org

Making WordPress.org

Changeset 2930


Ignore:
Timestamp:
04/11/2016 01:42:53 PM (3 years ago)
Author:
obenland
Message:

Plugin Directory: Initial setup for post status transitions.

Provides a place to handle post status transitions for plugins.

See #1570.

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

Legend:

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

    r2830 r2930  
    1616     * @param int    $user_id       The user ID.
    1717     * @param array  $context       Adds the context to the cap. Typically the object ID.
     18     * @return array Primitive caps.
    1819     */
    1920    public static function map_meta_cap( $required_caps, $cap, $user_id, $context ) {
     
    8182        $reviewer = array_merge( $committer, array(
    8283            'plugin_edit_pending' => true,
    83             'plugin_approve' => true,
    84             'plugin_reject' => true,
     84            'plugin_review' => true,
    8585        ) );
    8686
     
    8888            'plugin_add_committer' => true,
    8989            'plugin_edit_others' => true,
     90            'plugin_approve' => true,
     91            'plugin_reject' => true,
    9092            'plugin_disable' => true,
    9193            'plugin_close' => true,
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r2925 r2930  
    3434        if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) {
    3535            Admin\Customizations::instance();
     36
     37            add_action( 'transition_post_status', array( 'Admin\Status_Transitions', 'instance' ) );
    3638        }
    3739
     
    7678                'edit_posts'         => 'plugin_dashboard_access',
    7779                'edit_others_posts'  => 'plugin_edit_others',
     80                'publish_posts'      => 'plugin_approve',
    7881                'read_private_posts' => 'do_not_allow',
    7982                'delete_posts'       => 'do_not_allow',
    80                 'create_posts'       => 'do_not_allow'
     83                'create_posts'       => 'do_not_allow',
    8184            )
    8285        ) );
     
    125128            'label'                     => _x( 'Pending', 'plugin status', 'wporg-plugins' ),
    126129            'public'                    => false,
    127             'show_in_admin_status_list' => current_user_can( 'plugin_approve' ),
     130            'show_in_admin_status_list' => current_user_can( 'plugin_review' ),
    128131            'label_count'               => _n_noop( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>', 'wporg-plugins' ),
    129132        ) );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tools/class-svn.php

    r2649 r2930  
    88 */
    99class SVN {
     10
     11    public static function add( $dirs, $args = array() ) {
     12        return true;
     13    }
    1014
    1115    /**
     
    8286    }
    8387
     88    public static function mkdir( $dirs, $args = array() ) {
     89        return true;
     90    }
     91
    8492    /**
    8593     * Parse and escape the provided SVN arguements for usage on the CLI.
Note: See TracChangeset for help on using the changeset viewer.