diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css index 2697ca49d1..3bdef8b708 100644 --- a/wp-admin/css/colors-classic.css +++ b/wp-admin/css/colors-classic.css @@ -1582,7 +1582,8 @@ input[readonly] { background-color: #eee; } -p.popular-tags { +.popular-tags, +.feature-filter { background-color: #FFFFFF; border-color: #DFDFDF; } diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css index f0cf5a853d..9de89e8b17 100644 --- a/wp-admin/css/colors-fresh.css +++ b/wp-admin/css/colors-fresh.css @@ -1582,7 +1582,8 @@ input[readonly] { background-color: #eee; } -p.popular-tags { +.popular-tags, +.feature-filter { background-color: #FFFFFF; border-color: #DFDFDF; } diff --git a/wp-admin/css/ie.css b/wp-admin/css/ie.css index 1caff2cf7e..bbaa419e77 100644 --- a/wp-admin/css/ie.css +++ b/wp-admin/css/ie.css @@ -348,3 +348,7 @@ table.ie-fixed { * html .stuffbox textarea { border: 1px solid #DFDFDF; } + +* html .feature-filter .feature-group li { + width: 145px; +} diff --git a/wp-admin/css/theme-install.css b/wp-admin/css/theme-install.css index b3a2232503..d3152844da 100644 --- a/wp-admin/css/theme-install.css +++ b/wp-admin/css/theme-install.css @@ -111,4 +111,33 @@ body#theme-information { height: auto; } +.feature-filter { + -moz-border-radius: 8px; + -khtml-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + border-width: 1px; + border-style: solid; + padding: 8px 12px 0; + margin-bottom: 10px; +} +.feature-filter .feature-group { + float: left; + margin-bottom: 20px; + width: 725px; +} + +.feature-filter .feature-name { + float: left; + text-align: right; + width: 65px; +} + +.feature-filter .feature-group li { + display: inline; + float: left; + list-style-type: none; + padding-right: 25px; + min-width: 145px; +} diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index 42f8fb37d9..4be20051c7 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -66,38 +66,32 @@ function themes_api($action, $args = null) { } /** - * Retrieve popular WordPress theme tags. + * Retrive list of WordPress theme features (aka theme tags) * * @since 2.8.0 * - * @param array $args * @return array */ -function install_themes_popular_tags( $args = array() ) { - global $theme_field_defaults; - if ( !$cache = get_option('wporg_theme_popular_tags') ) - add_option('wporg_theme_popular_tags', array(), '', 'no'); ///No autoload. +function install_themes_feature_list( ) { + if ( !$cache = get_option( 'wporg_theme_feature_list' ) ) + add_option( 'wporg_theme_feature_list', array( ), '', 'no' ); - if ( $cache && $cache->timeout + 3 * 60 * 60 > time() ) + if ( $cache && $cache->timeout +3 * 60 * 60 > time( ) ) return $cache->cached; - $args['fields'] = $theme_field_defaults; + $feature_list = themes_api( 'feature_list', array( ) ); + if ( is_wp_error( $feature_list ) ) + return $features; - $tags = themes_api('hot_tags', $args); + $cache = (object) array( 'timeout' => time( ), 'cached' => $feature_list ); + update_option( 'wporg_theme_feature_list', $cache ); - if ( is_wp_error($tags) ) - return $tags; - - $cache = (object) array('timeout' => time(), 'cached' => $tags); - - update_option('wporg_theme_popular_tags', $cache); - - return $tags; + return $feature_list; } add_action('install_themes_search', 'install_theme_search', 10, 1); /** - * Display theme search results and display as tag cloud. + * Display theme search results * * @since 2.8.0 * @@ -127,6 +121,15 @@ function install_theme_search($page) { $args['page'] = $page; $args['fields'] = $theme_field_defaults; + if ( !empty( $_POST['features'] ) ) { + $terms = $_POST['features']; + $terms = array_map( 'trim', $terms ); + $terms = array_map( 'sanitize_title_with_dashes', $terms ); + $args['tag'] = $terms; + $_REQUEST['s'] = implode( ',', $terms ); + $_REQUEST['type'] = 'tag'; + } + $api = themes_api('query_themes', $args); if ( is_wp_error($api) ) @@ -137,54 +140,70 @@ function install_theme_search($page) { display_themes($api->themes, $api->info['page'], $api->info['pages']); } -add_action('install_themes_dashboard', 'install_themes_dashboard'); -function install_themes_dashboard() { - ?> -
- - - - - - clean_url( admin_url('theme-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ), - 'name' => $tag['name'], - 'id' => sanitize_title_with_dashes($tag['name']), - 'count' => $tag['count'] ); - } - echo '