Changeset 6034 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
- Timestamp:
- 10/16/2017 12:35:07 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r5997 r6034 41 41 add_filter( 'wp_unique_post_slug', array( $this, 'check_existing_plugin_slug_on_inline_save' ), 10, 6 ); 42 42 43 add_action( 'save_post', array( $this, 'save_close_reason' ), 10, 2 ); 44 43 45 add_action( 'wp_ajax_replyto-comment', array( $this, 'save_custom_comment' ), 0 ); 44 46 add_filter( 'comment_row_actions', array( $this, 'custom_comment_row_actions' ), 10, 2 ); … … 51 53 add_filter( 'postbox_classes_plugin_internal-notes', array( __NAMESPACE__ . '\Metabox\Internal_Notes', 'postbox_classes' ) ); 52 54 add_filter( 'postbox_classes_plugin_plugin-committers', array( __NAMESPACE__ . '\Metabox\Committers', 'postbox_classes' ) ); 53 add_filter( 'postbox_classes_plugin_plugin-support-reps', array( __NAMESPACE__ . '\Metabox\Support_Reps', 54 add_filter( 'wp_ajax_add-committer', array( __NAMESPACE__ . '\Metabox\Committers', 'add_committer' 55 add_filter( 'postbox_classes_plugin_plugin-support-reps', array( __NAMESPACE__ . '\Metabox\Support_Reps', 'postbox_classes' ) ); 56 add_filter( 'wp_ajax_add-committer', array( __NAMESPACE__ . '\Metabox\Committers', 'add_committer' ) ); 55 57 add_filter( 'wp_ajax_delete-committer', array( __NAMESPACE__ . '\Metabox\Committers', 'remove_committer' ) ); 56 58 add_filter( 'wp_ajax_add-support-rep', array( __NAMESPACE__ . '\Metabox\Support_Reps', 'add_support_rep' ) ); 57 59 add_filter( 'wp_ajax_delete-support-rep', array( __NAMESPACE__ . '\Metabox\Support_Reps', 'remove_support_rep' ) ); 58 60 add_action( 'wp_ajax_plugin-author-lookup', array( __NAMESPACE__ . '\Metabox\Author', 'lookup_author' ) ); 59 60 61 } 61 62 … … 378 379 379 380 /** 381 * Save the reason for closing or disabling a plugin. 382 * 383 * @param int $post_id Post ID. 384 * @param \WP_Post $post Post object. 385 */ 386 public function save_close_reason( $post_id, $post ) { 387 if ( 'plugin' !== $post->post_type || ! isset( $_POST['close_reason'] ) ) { 388 return; 389 } 390 391 if ( ! current_user_can( 'plugin_approve', $post_id ) ) { 392 return; 393 } 394 395 if ( ! in_array( $post->post_status, array( 'closed', 'disabled' ) ) ) { 396 return; 397 } 398 399 update_post_meta( $post_id, '_close_reason', sanitize_key( $_POST['close_reason'] ) ); 400 } 401 402 /** 380 403 * Register the Admin metaboxes for the plugin management screens. 381 404 *
Note: See TracChangeset
for help on using the changeset viewer.