diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css
index ddfaad3..2be5a13 100644
|
|
|
th.action-links { |
| 1087 | 1087 | color: #fff; |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| | 1090 | .wp-filter .favorites-form { |
| | 1091 | display: none; |
| | 1092 | margin: 0 -20px; |
| | 1093 | padding: 20px; |
| | 1094 | border-top: 1px solid #eee; |
| | 1095 | background: #fafafa; |
| | 1096 | overflow: hidden; |
| | 1097 | width: 100%; |
| | 1098 | } |
| | 1099 | |
| | 1100 | .show-favorites-form .wp-filter .favorites-form { |
| | 1101 | display: block; |
| | 1102 | } |
| | 1103 | |
| 1090 | 1104 | .filter-drawer { |
| 1091 | 1105 | display: none; |
| 1092 | 1106 | margin: 0 -20px; |
diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index 0170cd9..c35b775 100644
|
|
|
function wp_ajax_query_themes() { |
| 2815 | 2815 | 'fields' => $theme_field_defaults |
| 2816 | 2816 | ) ); |
| 2817 | 2817 | |
| | 2818 | if ( 'favorites' === $args['browse'] ) { |
| | 2819 | $user = get_user_option( 'wporg_favorites' ); |
| | 2820 | if ( $user ) { |
| | 2821 | $args['user'] = $user; |
| | 2822 | } |
| | 2823 | } |
| | 2824 | |
| 2818 | 2825 | $old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search'; |
| 2819 | 2826 | |
| 2820 | 2827 | /** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */ |
diff --git src/wp-admin/js/theme.js src/wp-admin/js/theme.js
index 0961922..28f3f4c 100644
|
|
|
themes.view.Installer = themes.view.Appearance.extend({ |
| 1448 | 1448 | $( '.filter-links li > a, .theme-filter' ).removeClass( this.activeClass ); |
| 1449 | 1449 | $( '[data-sort="' + sort + '"]' ).addClass( this.activeClass ); |
| 1450 | 1450 | |
| | 1451 | if ( 'favorites' === sort ) { |
| | 1452 | $ ( 'body' ).addClass( 'show-favorites-form' ); |
| | 1453 | } |
| | 1454 | |
| 1451 | 1455 | this.browse( sort ); |
| 1452 | 1456 | }, |
| 1453 | 1457 | |
| … |
… |
themes.RunInstaller = { |
| 1681 | 1685 | if ( ! sort ) { |
| 1682 | 1686 | sort = 'featured'; |
| 1683 | 1687 | } |
| 1684 | | self.view.sort( sort ); |
| | 1688 | self.view.sort( sort.split('&')[0] ); |
| 1685 | 1689 | self.view.trigger( 'theme:close' ); |
| 1686 | 1690 | }); |
| 1687 | 1691 | |
diff --git src/wp-admin/theme-install.php src/wp-admin/theme-install.php
index 6213a5a..e9d6254 100644
|
|
|
include(ABSPATH . 'wp-admin/admin-header.php'); |
| 139 | 139 | <li><a href="#" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a></li> |
| 140 | 140 | <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li> |
| 141 | 141 | <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li> |
| | 142 | <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li> |
| 142 | 143 | </ul> |
| 143 | 144 | |
| 144 | 145 | <a class="drawer-toggle" href="#"><?php _e( 'Feature Filter' ); ?></a> |
| 145 | 146 | |
| 146 | 147 | <div class="search-form"></div> |
| 147 | 148 | |
| | 149 | <div class="favorites-form"> |
| | 150 | <?php |
| | 151 | $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); |
| | 152 | update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); |
| | 153 | ?> |
| | 154 | <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p> |
| | 155 | |
| | 156 | <form method="get"> |
| | 157 | <p> |
| | 158 | <label for="user"><?php _e( 'Your WordPress.org username:' ); ?></label> |
| | 159 | <input type="hidden" name="browse" value="favorites" /> |
| | 160 | <input type="search" id="user" name="user" value="<?php echo esc_attr( $user ); ?>" /> |
| | 161 | <input type="submit" class="button button-secondary favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" /> |
| | 162 | </p> |
| | 163 | </form> |
| | 164 | </div> |
| | 165 | |
| 148 | 166 | <div class="filter-drawer"> |
| 149 | 167 | <div class="buttons"> |
| 150 | 168 | <a class="apply-filters button button-secondary" href="#"><?php _e( 'Apply Filters' ); ?><span></span></a> |