author | ymh <ymh.work@gmail.com> |
Mon, 14 Oct 2019 18:30:03 +0200 | |
changeset 10 | 372f2766ea20 |
parent 9 | 177826044cd9 |
child 16 | a86126ab1dd4 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Install theme administration panel. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** WordPress Administration Bootstrap */ |
|
10 |
require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
5 | 11 |
require( ABSPATH . 'wp-admin/includes/theme-install.php' ); |
12 |
||
13 |
wp_reset_vars( array( 'tab' ) ); |
|
0 | 14 |
|
9 | 15 |
if ( ! current_user_can( 'install_themes' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
16 |
wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); |
9 | 17 |
} |
0 | 18 |
|
19 |
if ( is_multisite() && ! is_network_admin() ) { |
|
20 |
wp_redirect( network_admin_url( 'theme-install.php' ) ); |
|
21 |
exit(); |
|
22 |
} |
|
23 |
||
9 | 24 |
$title = __( 'Add Themes' ); |
5 | 25 |
$parent_file = 'themes.php'; |
26 |
||
27 |
if ( ! is_network_admin() ) { |
|
28 |
$submenu_file = 'themes.php'; |
|
29 |
} |
|
30 |
||
31 |
$installed_themes = search_theme_directories(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
32 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
33 |
if ( false === $installed_themes ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
34 |
$installed_themes = array(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
|
5 | 37 |
foreach ( $installed_themes as $k => $v ) { |
38 |
if ( false !== strpos( $k, '/' ) ) { |
|
39 |
unset( $installed_themes[ $k ] ); |
|
40 |
} |
|
41 |
} |
|
0 | 42 |
|
9 | 43 |
wp_localize_script( |
44 |
'theme', |
|
45 |
'_wpThemeSettings', |
|
46 |
array( |
|
47 |
'themes' => false, |
|
48 |
'settings' => array( |
|
49 |
'isInstall' => true, |
|
50 |
'canInstall' => current_user_can( 'install_themes' ), |
|
51 |
'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null, |
|
52 |
'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ), |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
53 |
), |
9 | 54 |
'l10n' => array( |
55 |
'addNew' => __( 'Add New Theme' ), |
|
56 |
'search' => __( 'Search Themes' ), |
|
57 |
'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis) |
|
58 |
'upload' => __( 'Upload Theme' ), |
|
59 |
'back' => __( 'Back' ), |
|
60 |
'error' => sprintf( |
|
61 |
/* translators: %s: support forums URL */ |
|
62 |
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ), |
|
63 |
__( 'https://wordpress.org/support/' ) |
|
64 |
), |
|
65 |
'tryAgain' => __( 'Try Again' ), |
|
66 |
'themesFound' => __( 'Number of Themes found: %d' ), |
|
67 |
'noThemesFound' => __( 'No themes found. Try a different search.' ), |
|
68 |
'collapseSidebar' => __( 'Collapse Sidebar' ), |
|
69 |
'expandSidebar' => __( 'Expand Sidebar' ), |
|
70 |
/* translators: accessibility text */ |
|
71 |
'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ), |
|
72 |
), |
|
73 |
'installedThemes' => array_keys( $installed_themes ), |
|
74 |
) |
|
75 |
); |
|
0 | 76 |
|
77 |
wp_enqueue_script( 'theme' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
78 |
wp_enqueue_script( 'updates' ); |
0 | 79 |
|
5 | 80 |
if ( $tab ) { |
81 |
/** |
|
82 |
* Fires before each of the tabs are rendered on the Install Themes page. |
|
83 |
* |
|
84 |
* The dynamic portion of the hook name, `$tab`, refers to the current |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
85 |
* theme installation tab. Possible values are 'dashboard', 'search', 'upload', |
5 | 86 |
* 'featured', 'new', or 'updated'. |
87 |
* |
|
88 |
* @since 2.8.0 |
|
89 |
*/ |
|
90 |
do_action( "install_themes_pre_{$tab}" ); |
|
91 |
} |
|
0 | 92 |
|
93 |
$help_overview = |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
94 |
'<p>' . sprintf( |
9 | 95 |
/* translators: %s: Theme Directory URL */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
96 |
__( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ), |
9 | 97 |
__( 'https://wordpress.org/themes/' ) |
98 |
) . '</p>' . |
|
5 | 99 |
'<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' . |
100 |
'<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' . |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
101 |
'<p>' . sprintf( |
9 | 102 |
/* translators: %s: /wp-content/themes */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
103 |
__( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your %s directory.' ), |
9 | 104 |
'<code>/wp-content/themes</code>' |
105 |
) . '</p>'; |
|
0 | 106 |
|
9 | 107 |
get_current_screen()->add_help_tab( |
108 |
array( |
|
109 |
'id' => 'overview', |
|
110 |
'title' => __( 'Overview' ), |
|
111 |
'content' => $help_overview, |
|
112 |
) |
|
113 |
); |
|
0 | 114 |
|
115 |
$help_installing = |
|
9 | 116 |
'<p>' . __( 'Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you’re interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.' ) . '</p>' . |
117 |
'<p>' . __( 'To install the theme so you can preview it with your site’s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme’s thumbnail image.' ) . '</p>'; |
|
0 | 118 |
|
9 | 119 |
get_current_screen()->add_help_tab( |
120 |
array( |
|
121 |
'id' => 'installing', |
|
122 |
'title' => __( 'Previewing and Installing' ), |
|
123 |
'content' => $help_installing, |
|
124 |
) |
|
125 |
); |
|
0 | 126 |
|
127 |
get_current_screen()->set_help_sidebar( |
|
9 | 128 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
129 |
'<p>' . __( '<a href="https://codex.wordpress.org/Using_Themes#Adding_New_Themes">Documentation on Adding New Themes</a>' ) . '</p>' . |
|
130 |
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
|
0 | 131 |
); |
132 |
||
9 | 133 |
include( ABSPATH . 'wp-admin/admin-header.php' ); |
5 | 134 |
|
0 | 135 |
?> |
136 |
<div class="wrap"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
137 |
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
138 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
139 |
<?php |
5 | 140 |
|
141 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
142 |
* Filters the tabs shown on the Add Themes screen. |
5 | 143 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
144 |
* This filter is for backward compatibility only, for the suppression of the upload tab. |
5 | 145 |
* |
146 |
* @since 2.8.0 |
|
147 |
* |
|
9 | 148 |
* @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'. |
5 | 149 |
*/ |
150 |
$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) ); |
|
151 |
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
152 |
echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>'; |
5 | 153 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
154 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
155 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
156 |
<hr class="wp-header-end"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
157 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
158 |
<div class="error hide-if-js"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
159 |
<p><?php _e( 'The Theme Installer screen requires JavaScript.' ); ?></p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
160 |
</div> |
5 | 161 |
|
162 |
<div class="upload-theme"> |
|
163 |
<?php install_themes_upload(); ?> |
|
164 |
</div> |
|
165 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
166 |
<h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Filter themes list' ); ?></h2> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
167 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
168 |
<div class="wp-filter hide-if-no-js"> |
5 | 169 |
<div class="filter-count"> |
170 |
<span class="count theme-count"></span> |
|
171 |
</div> |
|
172 |
||
173 |
<ul class="filter-links"> |
|
174 |
<li><a href="#" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a></li> |
|
175 |
<li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li> |
|
176 |
<li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
177 |
<li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li> |
5 | 178 |
</ul> |
179 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
180 |
<button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
181 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
<form class="search-form"></form> |
5 | 183 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
184 |
<div class="favorites-form"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
185 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
186 |
$action = 'save_wporg_username_' . get_current_user_id(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
187 |
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
188 |
$user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
189 |
update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
190 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
191 |
$user = get_user_option( 'wporg_favorites' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
192 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
193 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
194 |
<p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
195 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
196 |
<p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
197 |
<label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
198 |
<input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
199 |
<input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
200 |
<input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
201 |
</p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
202 |
</div> |
5 | 203 |
|
204 |
<div class="filter-drawer"> |
|
205 |
<div class="buttons"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
206 |
<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
207 |
<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button> |
5 | 208 |
</div> |
209 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
210 |
$feature_list = get_theme_feature_list( false ); // Use the core list, rather than the .org API, due to inconsistencies and to ensure tags are translated. |
5 | 211 |
foreach ( $feature_list as $feature_name => $features ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
212 |
echo '<fieldset class="filter-group">'; |
5 | 213 |
$feature_name = esc_html( $feature_name ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
214 |
echo '<legend>' . $feature_name . '</legend>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
215 |
echo '<div class="filter-group-feature">'; |
5 | 216 |
foreach ( $features as $feature => $feature_name ) { |
217 |
$feature = esc_attr( $feature ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
218 |
echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> '; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
219 |
echo '<label for="filter-id-' . $feature . '">' . $feature_name . '</label>'; |
5 | 220 |
} |
221 |
echo '</div>'; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
222 |
echo '</fieldset>'; |
5 | 223 |
} |
224 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
225 |
<div class="buttons"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
226 |
<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
227 |
<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
228 |
</div> |
5 | 229 |
<div class="filtered-by"> |
230 |
<span><?php _e( 'Filtering by:' ); ?></span> |
|
231 |
<div class="tags"></div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
232 |
<button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button> |
5 | 233 |
</div> |
234 |
</div> |
|
235 |
</div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
236 |
<h2 class="screen-reader-text hide-if-no-js"><?php _e( 'Themes list' ); ?></h2> |
5 | 237 |
<div class="theme-browser content-filterable"></div> |
238 |
<div class="theme-install-overlay wp-full-overlay expanded"></div> |
|
239 |
||
240 |
<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> |
|
241 |
<span class="spinner"></span> |
|
0 | 242 |
|
5 | 243 |
<?php |
244 |
if ( $tab ) { |
|
245 |
/** |
|
246 |
* Fires at the top of each of the tabs on the Install Themes page. |
|
247 |
* |
|
248 |
* The dynamic portion of the hook name, `$tab`, refers to the current |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
249 |
* theme installation tab. Possible values are 'dashboard', 'search', 'upload', |
5 | 250 |
* 'featured', 'new', or 'updated'. |
251 |
* |
|
252 |
* @since 2.8.0 |
|
253 |
* |
|
254 |
* @param int $paged Number of the current page of results being viewed. |
|
255 |
*/ |
|
256 |
do_action( "install_themes_{$tab}", $paged ); |
|
257 |
} |
|
258 |
?> |
|
259 |
</div> |
|
260 |
||
261 |
<script id="tmpl-theme" type="text/template"> |
|
262 |
<# if ( data.screenshot_url ) { #> |
|
263 |
<div class="theme-screenshot"> |
|
264 |
<img src="{{ data.screenshot_url }}" alt="" /> |
|
265 |
</div> |
|
266 |
<# } else { #> |
|
267 |
<div class="theme-screenshot blank"></div> |
|
268 |
<# } #> |
|
269 |
<span class="more-details"><?php _ex( 'Details & Preview', 'theme' ); ?></span> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
270 |
<div class="theme-author"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
271 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
272 |
/* translators: %s: Theme author name */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
273 |
printf( __( 'By %s' ), '{{ data.author }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
274 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
275 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
276 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
277 |
<div class="theme-id-container"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
278 |
<h3 class="theme-name">{{ data.name }}</h3> |
5 | 279 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
280 |
<div class="theme-actions"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
281 |
<# if ( data.installed ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
282 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
283 |
/* translators: %s: Theme name */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
284 |
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
285 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
286 |
<# if ( data.activate_url ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
287 |
<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
288 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
289 |
<# if ( data.customize_url ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
290 |
<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
291 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
292 |
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
293 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
294 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
295 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
296 |
/* translators: %s: Theme name */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
297 |
$aria_label = sprintf( __( 'Install %s' ), '{{ data.name }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
298 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
299 |
<a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
300 |
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
301 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
302 |
</div> |
5 | 303 |
</div> |
304 |
||
305 |
<# if ( data.installed ) { #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
306 |
<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div> |
5 | 307 |
<# } #> |
308 |
</script> |
|
309 |
||
310 |
<script id="tmpl-theme-preview" type="text/template"> |
|
311 |
<div class="wp-full-overlay-sidebar"> |
|
312 |
<div class="wp-full-overlay-header"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
313 |
<button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button> |
9 | 314 |
<button class="previous-theme"><span class="screen-reader-text"><?php _e( 'Previous theme' ); ?></span></button> |
315 |
<button class="next-theme"><span class="screen-reader-text"><?php _e( 'Next theme' ); ?></span></button> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
316 |
<# if ( data.installed ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
317 |
<a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
318 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
319 |
<a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
320 |
<# } #> |
5 | 321 |
</div> |
322 |
<div class="wp-full-overlay-sidebar-content"> |
|
323 |
<div class="install-theme-info"> |
|
324 |
<h3 class="theme-name">{{ data.name }}</h3> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
325 |
<span class="theme-by"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
326 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
327 |
/* translators: %s: Theme author name */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
328 |
printf( __( 'By %s' ), '{{ data.author }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
329 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
330 |
</span> |
5 | 331 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
332 |
<img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" /> |
5 | 333 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
334 |
<div class="theme-details"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
335 |
<# if ( data.rating ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
336 |
<div class="theme-rating"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
337 |
{{{ data.stars }}} |
9 | 338 |
<a class="num-ratings" href="{{ data.reviews_url }}"> |
339 |
<?php |
|
340 |
/* translators: %s: number of ratings */ |
|
341 |
echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ); |
|
342 |
?> |
|
343 |
</a> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
344 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
345 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
346 |
<span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
347 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
348 |
<div class="theme-version"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
349 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
350 |
/* translators: %s: Theme version */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
351 |
printf( __( 'Version: %s' ), '{{ data.version }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
352 |
?> |
5 | 353 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
354 |
<div class="theme-description">{{{ data.description }}}</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
355 |
</div> |
5 | 356 |
</div> |
357 |
</div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
358 |
<div class="wp-full-overlay-footer"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
359 |
<button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
360 |
<span class="collapse-sidebar-arrow"></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
361 |
<span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
362 |
</button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
363 |
</div> |
5 | 364 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
365 |
<div class="wp-full-overlay-main"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
366 |
<iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe> |
5 | 367 |
</div> |
368 |
</script> |
|
0 | 369 |
|
370 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
371 |
wp_print_request_filesystem_credentials_modal(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
372 |
wp_print_admin_notice_templates(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
373 |
|
9 | 374 |
include( ABSPATH . 'wp-admin/admin-footer.php' ); |