Changeset 13874 for sites/trunk/wordpress.org/public_html
- Timestamp:
- 07/04/2024 03:08:32 AM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r13869 r13874 95 95 $assets = $data['assets']; 96 96 $headers = $data['plugin_headers']; 97 $version = $headers->Version ?? ''; 97 98 $stable_tag = $data['stable_tag']; 98 99 $last_committer = $data['last_committer']; … … 168 169 if ( ! $release ) { 169 170 // Use the actual version for stable releases, otherwise fallback to the tag name, as we don't have the actual header data. 170 $version = ( $svn_changed_tag === $stable_tag ) ? $ headers->Version : $svn_changed_tag;171 $version = ( $svn_changed_tag === $stable_tag ) ? $version : $svn_changed_tag; 171 172 172 173 Plugin_Directory::add_release( … … 298 299 */ 299 300 if ( 300 ( ! isset( $headers->Version ) || $headers->Version != get_post_meta( $plugin->ID, 'version', true ) ) ||301 ( ! $version || $version != get_post_meta( $plugin->ID, 'version', true ) ) || 301 302 $plugin->post_modified == '0000-00-00 00:00:00' || 302 303 ( $svn_changed_tags && in_array( ( $stable_tag ?: 'trunk' ), $svn_changed_tags, true ) ) … … 437 438 } 438 439 440 // Add the release to storage. 441 if ( 'trunk' != $stable_tag ) { 442 Plugin_Directory::add_release( 443 $plugin, 444 [ 445 'tag' => $stable_tag, 446 'version' => $version, 447 'committer' => [ $last_committer ], 448 'revision' => [ $last_revision ] 449 ] 450 ); 451 } 452 439 453 $this->rebuild_affected_zips( $plugin_slug, $stable_tag, $current_stable_tag, $svn_changed_tags, $svn_revision_triggered ); 440 454 441 455 // Finally, set the new version live. 442 456 update_post_meta( $plugin->ID, 'stable_tag', wp_slash( $stable_tag ) ); 443 update_post_meta( $plugin->ID, 'version', wp_slash( $ headers->Version ) );457 update_post_meta( $plugin->ID, 'version', wp_slash( $version ) ); 444 458 // Update the list of tags last, as it controls which ZIPs are present in the 'Previous versions' section and info API. 445 459 update_post_meta( $plugin->ID, 'tags', wp_slash( $tagged_versions ) ); … … 512 526 ) { 513 527 unset( $versions_to_build[ $i ] ); 514 } else {515 $release['zips_built'] = true;516 Plugin_Directory::add_release( $plugin, $release );517 528 } 518 529 } … … 541 552 } catch ( Exception $e ) { 542 553 return false; 554 } 555 556 // Mark the ZIPs as being built. 557 foreach ( $versions_to_build as $tag ) { 558 if ( 'trunk' === $tag ) { 559 continue; 560 } 561 562 Plugin_Directory::add_release( 563 $plugin, 564 [ 565 'tag' => $tag, 566 'zips_built' => true 567 ] 568 ); 543 569 } 544 570
Note: See TracChangeset
for help on using the changeset viewer.