mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
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: http://svn.automattic.com/wordpress/trunk@20592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a1e92cae9d
commit
d17afd15a4
@ -62,7 +62,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
|
||||
break;
|
||||
}
|
||||
|
||||
add_action( 'install_plugins_table_header', 'install_search_form' );
|
||||
add_action( 'install_plugins_table_header', 'install_search_form', 10, 0 );
|
||||
break;
|
||||
|
||||
case 'featured':
|
||||
|
@ -78,7 +78,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
|
||||
$_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;
|
||||
|
||||
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>
|
||||
|
||||
<h4><?php _e('Search') ?></h4>
|
||||
<p class="install-help"><?php _e('Search for plugins by keyword, author, or tag.') ?></p>
|
||||
<?php install_search_form(); ?>
|
||||
<?php install_search_form( false ); ?>
|
||||
|
||||
<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>
|
||||
@ -116,17 +115,19 @@ add_action('install_plugins_dashboard', 'install_dashboard');
|
||||
*
|
||||
* @since 2.7.0
|
||||
*/
|
||||
function install_search_form(){
|
||||
function install_search_form( $type_selector = true ) {
|
||||
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
|
||||
|
||||
?><form id="search-plugins" method="get" action="">
|
||||
<input type="hidden" name="tab" value="search" />
|
||||
<?php if ( $type_selector ) : ?>
|
||||
<select name="type" id="typeselector">
|
||||
<option value="term"<?php selected('term', $type) ?>><?php _e('Keyword'); ?></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>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
<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>
|
||||
<?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?>
|
||||
|
@ -49,19 +49,21 @@ function install_themes_feature_list( ) {
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
function install_theme_search_form() {
|
||||
function install_theme_search_form( $type_selector = true ) {
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||
$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="">
|
||||
<input type="hidden" name="tab" value="search" />
|
||||
<?php if ( $type_selector ) : ?>
|
||||
<select name="type" id="typeselector">
|
||||
<option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></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>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
<input type="search" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
|
||||
<?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
|
||||
</form>
|
||||
@ -74,10 +76,10 @@ function install_theme_search_form() {
|
||||
* @since 2.8.0
|
||||
*/
|
||||
function install_themes_dashboard() {
|
||||
install_theme_search_form();
|
||||
install_theme_search_form( false );
|
||||
?>
|
||||
<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="">
|
||||
<input type="hidden" name="tab" value="search" />
|
||||
|
Loading…
Reference in New Issue
Block a user