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.
Built from https://develop.svn.wordpress.org/trunk@52936


git-svn-id: http://core.svn.wordpress.org/trunk@52525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-03-15 15:58:02 +00:00
parent 1cd42e3cbe
commit 0e95737d10
2 changed files with 17 additions and 21 deletions

View File

@ -266,18 +266,8 @@ function install_popular_tags( $args = array() ) {
* @since 2.7.0
*/
function install_dashboard() {
display_plugins_table();
?>
<p>
<?php
printf(
/* translators: %s: https://wordpress.org/plugins/ */
__( '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.' ),
__( 'https://wordpress.org/plugins/' )
);
?>
</p>
<?php display_plugins_table(); ?>
<div class="plugins-popular-tags-wrapper">
<h2><?php _e( 'Popular tags' ); ?></h2>
@ -395,14 +385,6 @@ function display_plugins_table() {
global $wp_list_table;
switch ( current_filter() ) {
case 'install_plugins_favorites':
if ( empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) {
return;
}
break;
case 'install_plugins_recommended':
echo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>';
break;
case 'install_plugins_beta':
printf(
/* translators: %s: URL to "Features as Plugins" page. */
@ -410,8 +392,22 @@ function display_plugins_table() {
'https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/'
);
break;
case 'install_plugins_featured':
printf(
/* translators: %s: https://wordpress.org/plugins/ */
'<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>',
__( 'https://wordpress.org/plugins/' )
);
break;
case 'install_plugins_recommended':
echo '<p>' . __( 'These suggestions are based on the plugins you and other users have installed.' ) . '</p>';
break;
case 'install_plugins_favorites':
if ( empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) {
return;
}
break;
}
?>
<form id="plugin-filter" method="post">
<?php $wp_list_table->display(); ?>

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-alpha-52935';
$wp_version = '6.0-alpha-52936';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.