Changeset 2929
- Timestamp:
- 04/11/2016 01:37:50 PM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r2927 r2929 26 26 private function __construct() { 27 27 // Admin Metaboxes 28 add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ), 10, 1);28 add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ), 10, 2 ); 29 29 add_action( 'do_meta_boxes', array( $this, 'replace_title_global' ) ); 30 30 … … 220 220 * Register the Admin metaboxes for the plugin management screens. 221 221 * 222 * @param string $post_type The post type of the current screen. 222 * @param string $post_type The post type of the current screen. 223 * @param \WP_Post $post Post object. 223 224 * @return void. 224 225 */ 225 public function register_admin_metaboxes( $post_type ) {226 public function register_admin_metaboxes( $post_type, $post ) { 226 227 if ( 'plugin' != $post_type ) { 227 228 return; … … 260 261 ); 261 262 262 add_meta_box( 263 'plugin-committers', 264 __( 'Plugin Committers', 'wporg-plugins' ), 265 array( __NAMESPACE__ . '\Metabox\Committers', 'display' ), 266 'plugin', 'side' 267 ); 263 if ( 'publish' === $post->post_status ) { 264 add_meta_box( 265 'plugin-committers', 266 __( 'Plugin Committers', 'wporg-plugins' ), 267 array( __NAMESPACE__ . '\Metabox\Committers', 'display' ), 268 'plugin', 'side' 269 ); 270 } 268 271 269 272 // Remove unnecessary metaboxes. -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-committers.php
r2789 r2929 40 40 41 41 check_ajax_referer( 'add-committer' ); 42 43 if ( ! current_user_can( 'plugin_add_committer', $post_id ) || 'publish' !== get_post_status( $post_id ) ) { 44 wp_die( -1 ); 45 } 46 42 47 global $post; 43 48 … … 51 56 ) ); 52 57 $response->send(); 53 }54 55 if ( ! current_user_can( 'plugin_add_committer', $post_id ) ) {56 wp_die( -1 );57 58 } 58 59 … … 89 90 check_ajax_referer( "remove-committer-$id" ); 90 91 92 if ( ! current_user_can( 'plugin_remove_committer', $post_id ) || 'publish' !== get_post_status( $post_id ) ) { 93 wp_die( -1 ); 94 } 95 91 96 $response = new \WP_Ajax_Response(); 92 97 $plugin_slug = get_post( $post_id )->post_name; … … 100 105 } 101 106 102 if ( ! current_user_can( 'plugin_remove_committer', $post_id ) ) {103 wp_die( -1 );104 }105 106 107 $result = Tools::revoke_plugin_committer( $plugin_slug, $committer ); 107 108
Note: See TracChangeset
for help on using the changeset viewer.