Changeset 6217 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.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/class-plugin-directory.php
r6207 r6217 343 343 'label_count' => _n_noop( 'Rejected <span class="count">(%s)</span>', 'Rejected <span class="count">(%s)</span>', 'wporg-plugins' ), 344 344 ) ); 345 346 add_action( 'transition_post_status', array( $this, 'plugin_close_date' ), 10, 3 );347 345 348 346 /** … … 1342 1340 } 1343 1341 1344 /**1345 * Save the date a plugin was closed and delete that date when it's reopened.1346 *1347 * @param string $new_status The new plugin status.1348 * @param string $old_status The old plugin status.1349 * @param WP_Post $post Post data.1350 */1351 public function plugin_close_date( $new_status, $old_status, $post ) {1352 if ( in_array( $new_status, array( 'closed', 'disabled' ) ) ) {1353 update_post_meta( $post->ID, 'plugin_closed_date', current_time( 'mysql' ) );1354 }1355 if ( 'publish' === $new_status && in_array( $old_status, array( 'closed', 'disabled' ) ) ) {1356 delete_post_meta( $post->ID, 'plugin_closed_date' );1357 }1358 }1359 1342 }
Note: See TracChangeset
for help on using the changeset viewer.