Making WordPress.org

Changeset 13211

Timestamp:
02/14/2024 01:02:07 AM (6 months ago)
Author:
tellyworth
Message:

Plugin Directory: fewer Plugin Check buttons

On the plugin upload pending screen, only show the Plugin Check button for the most recent version of the plugin. This should eliminate confusion about which button to click.

See #7405.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php

    r13198 r13211  
    290290                                echo '<li>' . sprintf( __( 'Version: %s', 'wporg-plugins' ), '<code>' . esc_html( $upload->version ) . '</code>' ) . '</li>';
    291291                                echo '<li>' . sprintf( __( 'Upload Date: %s', 'wporg-plugins' ), date_i18n( get_option( 'date_format' ), strtotime( $upload->post_date ) ) ) . '</li>';
    292                                 printf(
    293                                     '<li><a href="%s" class="%s" target="_blank">%s</a></li>',
    294                                     esc_url( Template::preview_link_zip( $plugin->post_name, $upload->ID, 'pcp' ) ),
    295                                     ( array_key_first( $attached_media) === $attachment_post_id ? 'button button-primary' : 'button button-secondary' ),
    296                                     __( 'Check with Plugin Check', 'wporg-plugins' )
    297                                 );
     292                                if ( array_key_first( $attached_media) === $attachment_post_id ) {
     293                                    printf(
     294                                        '<li><a href="%s" class="%s" target="_blank">%s</a></li>',
     295                                        esc_url( Template::preview_link_zip( $plugin->post_name, $upload->ID, 'pcp' ) ),
     296                                        'button button-primary',
     297                                        __( 'Check with Plugin Check', 'wporg-plugins' )
     298                                    );
     299                                }
    298300                                echo '</ul></li>';
    299301                            }
Note: See TracChangeset for help on using the changeset viewer.