diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index 52c4ab7881..6ec7966cd7 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -47,7 +47,7 @@ function themes_api($action, $args = null) { $res = new WP_Error('themes_api_failed', __('An unknown error occured'), $request['body']); } } - + //var_dump(array($args, $res)); return apply_filters('themes_api_result', $res, $action, $args); } @@ -94,7 +94,10 @@ function install_theme_search($page) { switch( $type ){ case 'tag': - $args['tag'] = sanitize_title_with_dashes($term); + $terms = explode(',', $term); + $terms = array_map('trim', $terms); + $terms = array_map('sanitize_title_with_dashes', $terms); + $args['tag'] = $terms; break; case 'term': $args['search'] = $term; @@ -257,29 +260,77 @@ function display_themes($themes, $page = 1, $totalpages = 1) { ?>
- +
- add_query_arg('paged', '%#%', $url), - 'format' => '', - 'prev_text' => __('«'), - 'next_text' => __('»'), - 'total' => $totalpages, - 'current' => $page - )); + $page_links = paginate_links( array( + 'base' => add_query_arg('paged', '%#%', $url), + 'format' => '', + 'prev_text' => __('«'), + 'next_text' => __('»'), + 'total' => $totalpages, + 'current' => $page + )); - if ( $page_links ) - echo "\t\t
$page_links
"; + if ( $page_links ) + echo "\t\t
$page_links
"; ?>
+
+ name, $themes_allowedtags); + $desc = wp_kses($theme->description, $themes_allowedtags); + if ( strlen($desc) > 30 ) + $desc = substr($desc, 0, 30) . '...' . substr($desc, 30) . ''; + + $action_links = array(); + $action_links[] = '' . __('Install') . ''; + $action_links[] = '' . __('Preview') . ''; + + $action_links = apply_filters('theme_install_action_links', $action_links, $theme); + $actions = implode ( ' | ', $action_links ); + echo " +
+

{$theme->name}

+
+
+ {$desc} +
+ $actions +
+
"; + /* + object(stdClass)[59] + public 'name' => string 'Magazine Basic' (length=14) + public 'slug' => string 'magazine-basic' (length=14) + public 'version' => string '1.1' (length=3) + public 'author' => string 'tinkerpriest' (length=12) + public 'preview_url' => string 'http://wp-themes.com/?magazine-basic' (length=36) + public 'screenshot_url' => string 'http://wp-themes.com/wp-content/themes/magazine-basic/screenshot.png' (length=68) + public 'rating' => float 80 + public 'num_ratings' => int 1 + public 'homepage' => string 'http://wordpress.org/extend/themes/magazine-basic' (length=49) + public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by c.bavota of Tinker Priest Media.' (length=214) + public 'download_link' => string 'http://wordpress.org/extend/themes/download/magazine-basic.1.1.zip' (length=66) + */ + } + + ?> +
diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index a3229c7370..2993d47625 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -18,11 +18,8 @@ $title = __('Install Themes'); $parent_file = 'themes.php'; wp_reset_vars( array('tab', 'paged') ); -//wp_enqueue_style( 'theme-install' ); -//wp_enqueue_script( 'theme-install' ); -//TODO: Combine? This'll do until a new UI is dreamed up though :) -wp_enqueue_style( 'plugin-install' ); -wp_enqueue_script( 'plugin-install' ); +wp_enqueue_style( 'theme-install' ); +wp_enqueue_script( 'theme-install' ); add_thickbox(); @@ -31,8 +28,9 @@ $tabs = array(); $tabs['dashboard'] = __('Start Page'); //TODO: Better name? if ( 'search' == $tab ) $tabs['search'] = __('Search Results'); +$tabs['tag-filter'] = __('Tag Filter'); $tabs['featured'] = __('Featured'); -$tabs['popular'] = __('Popular'); +//$tabs['popular'] = __('Popular'); $tabs['new'] = __('Newest'); $tabs['updated'] = __('Recently Updated');