Ticket #1721: 1721.diff
File 1721.diff, 1.4 KB (added by , 9 years ago) |
---|
-
admin/class-status-transitions.php
26 26 private function __construct() { 27 27 add_action( 'approved_plugin', array( $this, 'approved' ), 10, 2 ); 28 28 add_action( 'rejected_plugin', array( $this, 'rejected' ), 10, 2 ); 29 30 add_action( 'transition_post_status', array( $this, 'record_status_change' ), 10, 3 ); 29 31 } 30 32 31 33 /** … … 161 163 } 162 164 163 165 /** 166 * Records the time a plugin was transitioned into a specific status. 167 * 168 * @param string $new_status New post status. 169 * @param string $old_status Old post status. 170 * @param \WP_Post $post Post object. 171 */ 172 public function record_status_change( $new_status, $old_status, $post ) { 173 if ( 'plugin' === $post->post_type ) { 174 update_post_meta( $post->ID, "_{$new_status}", strtotime( $post->post_modified_gmt ) ); 175 } 176 } 177 178 /** 164 179 * Returns the path to a plugins root directory. 165 180 * 166 181 * @param string $dir Directory to search in. -
cli/class-import.php
92 92 'post_modified_gmt' => $topic->topic_time, 93 93 'meta_input' => array( 94 94 '_author_ip' => $author_ip, 95 '_publish' => $topic->approved, 95 96 ), 96 97 ) ); 97 98 }