Changeset 6217 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
- Timestamp:
- 12/03/2017 07:32:59 PM (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
r6129 r6217 40 40 add_filter( 'wp_insert_post_data', array( $this, 'check_existing_plugin_slug_on_post_update' ), 10, 2 ); 41 41 add_filter( 'wp_unique_post_slug', array( $this, 'check_existing_plugin_slug_on_inline_save' ), 10, 6 ); 42 43 add_action( 'save_post', array( $this, 'save_close_reason' ), 10, 2 );44 42 45 43 add_action( 'wp_ajax_replyto-comment', array( $this, 'save_custom_comment' ), 0 ); … … 379 377 380 378 /** 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 update_post_meta( $post_id, '_close_date', current_time( 'mysql' ) );401 }402 403 /**404 379 * Register the Admin metaboxes for the plugin management screens. 405 380 *
Note: See TracChangeset
for help on using the changeset viewer.