WordPress.org

Making WordPress.org

Changeset 2789


Ignore:
Timestamp:
03/24/2016 06:28:01 PM (3 years ago)
Author:
obenland
Message:

Plugin Directory: Make plugin post available in global scope.

\List_Table\Committers::single_row() needs it to be available globally, so
that permission checks for removing a committer work.

See #1570.

File:
1 edited

Legend:

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

    r2777 r2789  
    4040
    4141        check_ajax_referer( 'add-committer' );
     42        global $post;
    4243
    43         $response    = new \WP_Ajax_Response();
    44         $plugin_slug = get_post( $post_id )->post_name;
     44        $response = new \WP_Ajax_Response();
     45        $post     = get_post( $post_id );
    4546
    4647        if ( ! $committer = get_user_by( 'login', $login ) ) {
     
    5657        }
    5758
    58         $result = Tools::grant_plugin_committer( $plugin_slug, $committer );
     59        $result = Tools::grant_plugin_committer( $post->post_name, $committer );
    5960
    6061        if ( ! $result ) {
Note: See TracChangeset for help on using the changeset viewer.