Changeset 6073
- Timestamp:
- 11/02/2017 05:37:31 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
r6022 r6073 82 82 $plugin->post_excerpt = trim( $readme->short_description ) ?: $headers->Description ?: $plugin->post_excerpt; 83 83 84 // Bump last updated if the version has changed, or if the post_modified is empty (which is the case for many initial checkins). 85 if ( ( !isset( $headers->Version ) || $headers->Version != get_post_meta( $plugin->ID, 'version', true ) ) || 86 ( $plugin->post_modified == '0000-00-00 00:00:00' ) ) { 84 /* 85 * Bump last updated if: 86 * - The version has changed. 87 * - The post_modified is empty, which is the case for many initial checkins. 88 * - A tag (or trunk) commit is made to the current stable. The build has changed, even if not new version. 89 */ 90 if ( 91 ( !isset( $headers->Version ) || $headers->Version != get_post_meta( $plugin->ID, 'version', true ) ) || 92 $plugin->post_modified == '0000-00-00 00:00:00' || 93 ( $svn_changed_tags && in_array( $svn_changed_tags, ( $stable_tag ?: 'trunk' ), true ) ) 94 ) { 87 95 $plugin->post_modified = $plugin->post_modified_gmt = current_time( 'mysql' ); 88 96 } … … 136 144 137 145 foreach ( $this->plugin_headers as $plugin_header => $meta_field ) { 146 if ( 'Version' == $plugin_header ) { 147 continue; // We'll specifically update the latest version after everything is built. 148 } 138 149 update_post_meta( $plugin->ID, $meta_field, ( isset( $headers->$plugin_header ) ? wp_slash( $headers->$plugin_header ) : '' ) ); 139 150 } … … 160 171 161 172 // Finally, set the new version live. 162 update_post_meta( $plugin->ID, 'stable_tag', $stable_tag ); 173 update_post_meta( $plugin->ID, 'stable_tag', wp_slash( $stable_tag ) ); 174 update_post_meta( $plugin->ID, 'version', wp_slash( $headers->Version ) ); 163 175 164 176 // Ensure that the API gets the updated data
Note: See TracChangeset
for help on using the changeset viewer.