Make WordPress Core

Changeset 52936


Ignore:
Timestamp:
03/15/2022 03:56:37 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Plugins: Move the introduction text from install_dashboard() to display_plugins_table().

This brings some consistency to how the introduction is displayed for the Beta Testing, Featured, and Recommended tabs of the Add Plugins screen.

This commit also reorders the switch cases for the text in the same order as they are displayed.

Follow-up to [9141], [30889], [36297].

Props sabbir1991, kapilpaul.
Fixes #55389.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin-install.php

    r52934 r52936  
    267267 */
    268268function install_dashboard() {
     269    display_plugins_table();
    269270    ?>
    270     <p>
    271         <?php
    272         printf(
    273             /* translators: %s: https://wordpress.org/plugins/ */
    274             __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%s">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.' ),
    275             __( 'https://wordpress.org/plugins/' )
    276         );
    277         ?>
    278     </p>
    279 
    280     <?php display_plugins_table(); ?>
    281271
    282272    <div class="plugins-popular-tags-wrapper">
     
    396386
    397387    switch ( current_filter() ) {
    398         case 'install_plugins_favorites':
    399             if ( empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) {
    400                 return;
    401             }
    402             break;
    403         case 'install_plugins_recommended':
    404             echo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>';
    405             break;
    406388        case 'install_plugins_beta':
    407389            printf(
     
    411393            );
    412394            break;
    413     }
    414 
     395        case 'install_plugins_featured':
     396            printf(
     397                /* translators: %s: https://wordpress.org/plugins/ */
     398                '<p>' . __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%s">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.' ) . '</p>',
     399                __( 'https://wordpress.org/plugins/' )
     400            );
     401            break;
     402        case 'install_plugins_recommended':
     403            echo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>';
     404            break;
     405        case 'install_plugins_favorites':
     406            if ( empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) {
     407                return;
     408            }
     409            break;
     410    }
    415411    ?>
    416412    <form id="plugin-filter" method="post">
Note: See TracChangeset for help on using the changeset viewer.