Changeset 6204 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
- Timestamp:
- 12/03/2017 04:35:29 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
r6198 r6204 340 340 'label_count' => _n_noop( 'Rejected <span class="count">(%s)</span>', 'Rejected <span class="count">(%s)</span>', 'wporg-plugins' ), 341 341 ) ); 342 343 add_action( 'transition_post_status', array( $this, 'plugin_close_date' ), 10, 3 ); 342 344 343 345 /** … … 1311 1313 return $result; 1312 1314 } 1315 1316 /** 1317 * Save the date a plugin was closed and delete that date when it's reopened. 1318 * 1319 * @param string $new_status The new plugin status. 1320 * @param string $old_status The old plugin status. 1321 * @param WP_Post $post Post data. 1322 */ 1323 public function plugin_close_date( $new_status, $old_status, $post ) { 1324 if ( in_array( $new_status, array( 'closed', 'disabled' ) ) ) { 1325 update_post_meta( $post->ID, 'plugin_closed_date', current_time( 'mysql' ) ); 1326 } 1327 if ( 'publish' === $new_status && in_array( $old_status, array( 'closed', 'disabled' ) ) ) { 1328 delete_post_meta( $post->ID, 'plugin_closed_date' ); 1329 } 1330 } 1313 1331 }
Note: See TracChangeset
for help on using the changeset viewer.