Changeset 12816
- Timestamp:
- 08/08/2023 05:38:53 AM (14 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r12508 r12816 1533 1533 foreach ( $tags as $tag_version => $tag ) { 1534 1534 self::add_release( $plugin, [ 1535 'date' => strtotime( $tag['date'] ), 1536 'tag' => $tag['tag'], 1537 'version' => $tag_version, 1538 'committer' => [ $tag['author'] ], 1539 'confirmations_required' => 0, // Old release, assume it's released. 1535 'date' => strtotime( $tag['date'] ), 1536 'tag' => $tag['tag'], 1537 'version' => $tag_version, 1538 'committer' => [ $tag['author'] ], 1539 'zips_built' => true, // Old release, assume they were built. 1540 'confirmations_required' => 0, // Old release, assume it's released. 1540 1541 ] ); 1541 1542 } … … 1557 1558 1558 1559 self::add_release( $plugin, [ 1559 'date' => strtotime( $entry['date'] ), 1560 'tag' => $entry['filename'], 1561 'version' => $tag, 1562 'committer' => [ $entry['author'] ], 1563 'confirmations_required' => 0, // Old release, assume it's released. 1560 'date' => strtotime( $entry['date'] ), 1561 'tag' => $entry['filename'], 1562 'version' => $tag, 1563 'committer' => [ $entry['author'] ], 1564 'zips_built' => true, // Old release, assume they were built. 1565 'confirmations_required' => 0, // Old release, assume it's released. 1564 1566 ] ); 1565 1567 } … … 1567 1569 1568 1570 $releases = get_post_meta( $plugin->ID, 'releases', true ) ?: []; 1571 } 1572 1573 /** 1574 * If confirmations weren't required, claim that the ZIPs were built. 1575 * 1576 * This is needed for data pre-[12816]. 1577 * @see https://meta.trac.wordpress.org/changeset/12816 1578 */ 1579 foreach ( $releases as &$release ) { 1580 if ( ! $release['confirmations_required'] && ! $release['zips_built'] ) { 1581 $release['zips_built'] = true; 1582 } 1569 1583 } 1570 1584 … … 1600 1614 'tag' => '', 1601 1615 'version' => '', 1602 'zips_built' => false, 1616 // Assume zips built if no release confirmation. 1617 'zips_built' => ! $plugin->release_confirmation, 1603 1618 'confirmations' => [], 1604 1619 // Confirmed by default if no release confiration. -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/inc/template-tags.php
r12813 r12816 370 370 echo '<select class="previous-versions" onchange="getElementById(\'download-previous-link\').href=this.value;">'; 371 371 foreach ( $tags as $version ) { 372 $text = ( 'trunk' === $version ? __( 'Development Version', 'wporg-plugins' ) : $version ); 373 printf( '<option value="%s">%s</option>', esc_attr( Template::download_link( $post, $version ) ), esc_html( $text ) ); 372 // Check the tag against the confirmed releases. 373 $release = Plugin_Directory::get_release( $post, $version ); 374 if ( $release && ! $release['zips_built'] ) { 375 continue; 376 } 377 378 $text = $version; 379 if ( 'trunk' === $version ) { 380 $text = __( 'Development Version', 'wporg-plugins' ); 381 } 382 383 printf( 384 '<option value="%s">%s</option>', 385 esc_attr( Template::download_link( $post, $version ) ), 386 esc_html( $text ) 387 ); 374 388 } 375 389 echo '</select> ';
Note: See TracChangeset
for help on using the changeset viewer.