Reduce clutter and repetive functionality from the initial landing page for installing plugins and themes by removing the tag/author/term dropdown.
The tag cloud (plugins) and feature filter (themes) is sufficient for tag functionality. All three "search by" fields are already weighted for a standard keyword search through the WP.org API. fixes #19619 for 3.4. git-svn-id: https://develop.svn.wordpress.org/trunk@20592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
de55e6200e
commit
cfe73da905
@ -62,7 +62,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'install_plugins_table_header', 'install_search_form' );
|
add_action( 'install_plugins_table_header', 'install_search_form', 10, 0 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'featured':
|
case 'featured':
|
||||||
|
@ -78,7 +78,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
|
|||||||
$_REQUEST['type'] = 'tag';
|
$_REQUEST['type'] = 'tag';
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'install_themes_table_header', 'install_theme_search_form' );
|
add_action( 'install_themes_table_header', 'install_theme_search_form', 10, 0 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'featured':
|
case 'featured':
|
||||||
|
@ -84,8 +84,7 @@ function install_dashboard() {
|
|||||||
<p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%s">this page</a>.' ), self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>
|
<p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%s">this page</a>.' ), self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>
|
||||||
|
|
||||||
<h4><?php _e('Search') ?></h4>
|
<h4><?php _e('Search') ?></h4>
|
||||||
<p class="install-help"><?php _e('Search for plugins by keyword, author, or tag.') ?></p>
|
<?php install_search_form( false ); ?>
|
||||||
<?php install_search_form(); ?>
|
|
||||||
|
|
||||||
<h4><?php _e('Popular tags') ?></h4>
|
<h4><?php _e('Popular tags') ?></h4>
|
||||||
<p class="install-help"><?php _e('You may also browse based on the most popular tags in the Plugin Directory:') ?></p>
|
<p class="install-help"><?php _e('You may also browse based on the most popular tags in the Plugin Directory:') ?></p>
|
||||||
@ -116,17 +115,19 @@ add_action('install_plugins_dashboard', 'install_dashboard');
|
|||||||
*
|
*
|
||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
*/
|
*/
|
||||||
function install_search_form(){
|
function install_search_form( $type_selector = true ) {
|
||||||
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
|
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||||
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
|
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
|
||||||
|
|
||||||
?><form id="search-plugins" method="get" action="">
|
?><form id="search-plugins" method="get" action="">
|
||||||
<input type="hidden" name="tab" value="search" />
|
<input type="hidden" name="tab" value="search" />
|
||||||
|
<?php if ( $type_selector ) : ?>
|
||||||
<select name="type" id="typeselector">
|
<select name="type" id="typeselector">
|
||||||
<option value="term"<?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
|
<option value="term"<?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
|
||||||
<option value="author"<?php selected('author', $type) ?>><?php _e('Author'); ?></option>
|
<option value="author"<?php selected('author', $type) ?>><?php _e('Author'); ?></option>
|
||||||
<option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option>
|
<option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option>
|
||||||
</select>
|
</select>
|
||||||
|
<?php endif; ?>
|
||||||
<input type="search" name="s" value="<?php echo esc_attr($term) ?>" />
|
<input type="search" name="s" value="<?php echo esc_attr($term) ?>" />
|
||||||
<label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label>
|
<label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label>
|
||||||
<?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?>
|
<?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?>
|
||||||
|
@ -49,19 +49,21 @@ function install_themes_feature_list( ) {
|
|||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*/
|
*/
|
||||||
function install_theme_search_form() {
|
function install_theme_search_form( $type_selector = true ) {
|
||||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
|
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||||
$term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
|
$term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
|
||||||
|
if ( ! $type_selector )
|
||||||
|
echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
|
||||||
?>
|
?>
|
||||||
<p class="install-help"><?php _e('Search for themes by keyword, author, or tag.') ?></p>
|
|
||||||
|
|
||||||
<form id="search-themes" method="get" action="">
|
<form id="search-themes" method="get" action="">
|
||||||
<input type="hidden" name="tab" value="search" />
|
<input type="hidden" name="tab" value="search" />
|
||||||
|
<?php if ( $type_selector ) : ?>
|
||||||
<select name="type" id="typeselector">
|
<select name="type" id="typeselector">
|
||||||
<option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
|
<option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
|
||||||
<option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option>
|
<option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option>
|
||||||
<option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
|
<option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
|
||||||
</select>
|
</select>
|
||||||
|
<?php endif; ?>
|
||||||
<input type="search" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
|
<input type="search" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
|
||||||
<?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
|
<?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
|
||||||
</form>
|
</form>
|
||||||
@ -74,10 +76,10 @@ function install_theme_search_form() {
|
|||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*/
|
*/
|
||||||
function install_themes_dashboard() {
|
function install_themes_dashboard() {
|
||||||
install_theme_search_form();
|
install_theme_search_form( false );
|
||||||
?>
|
?>
|
||||||
<h4><?php _e('Feature Filter') ?></h4>
|
<h4><?php _e('Feature Filter') ?></h4>
|
||||||
<p class="install-help"><?php _e('Find a theme based on specific features') ?></p>
|
<p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p>
|
||||||
|
|
||||||
<form method="get" action="">
|
<form method="get" action="">
|
||||||
<input type="hidden" name="tab" value="search" />
|
<input type="hidden" name="tab" value="search" />
|
||||||
|
Loading…
Reference in New Issue
Block a user