Changeset 4565
- Timestamp:
- 12/21/2016 07:44:58 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r4564 r4565 80 80 } 81 81 82 $plugin_existed_already = (bool) $plugin; 82 83 if ( ! $plugin ) { 83 84 $author_ip = $wpdb->get_var( $wpdb->prepare( 'SELECT poster_ip FROM ' . PLUGINS_TABLE_PREFIX . 'posts WHERE topic_id = %s', $topic->topic_id ) ); 84 85 86 add_filter( 'wp_insert_post_data', array( $this, 'filter_wp_insert_post_data' ), 10, 2 ); 85 87 $plugin = Plugin_Directory::create_plugin_post( array( 86 88 'post_name' => $plugin_slug, 87 89 'post_status' => $status, 88 90 'post_author' => $topic->topic_poster, 89 'override_modified_date' => true,90 91 'post_date_gmt' => $topic->topic_start_time, 91 92 'post_date' => $topic->topic_start_time, … … 94 95 'meta_input' => array( 95 96 '_author_ip' => $author_ip, 96 '_publish' => $topic->approved,97 97 ), 98 98 ) ); 99 remove_filter( 'wp_insert_post_data', array( $this, 'filter_wp_insert_post_data' ) ); 99 100 } 100 101 $plugin->post_status = $status; … … 120 121 $plugin->post_excerpt = trim( $readme->short_description ) ?: $headers->Description ?: $plugin->post_excerpt; 121 122 122 // Bump last updated if the version has changed .123 // Bump last updated if the version has changed, but only if this isn't a fresh import. 123 124 if ( !isset( $headers->Version ) || $headers->Version != get_post_meta( $plugin->ID, 'version', true ) ) { 124 $plugin->post_modified = $plugin->post_modified_gmt = current_time( 'mysql' ); 125 if ( $plugin_existed_already ) { 126 $plugin->post_modified = $plugin->post_modified_gmt = current_time( 'mysql' ); 127 } 125 128 } 126 129
Note: See TracChangeset
for help on using the changeset viewer.