author | ymh <ymh.work@gmail.com> |
Mon, 08 Sep 2025 19:44:41 +0200 | |
changeset 23 | 417f20492bf7 |
parent 22 | 8c2e4d02f4ef |
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 */ |
|
16 | 10 |
require_once __DIR__ . '/admin.php'; |
11 |
require ABSPATH . 'wp-admin/includes/theme-install.php'; |
|
5 | 12 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
13 |
$tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['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' ) ); |
|
16 | 21 |
exit; |
0 | 22 |
} |
23 |
||
19 | 24 |
// Used in the HTML title tag. |
9 | 25 |
$title = __( 'Add Themes' ); |
5 | 26 |
$parent_file = 'themes.php'; |
27 |
||
28 |
if ( ! is_network_admin() ) { |
|
29 |
$submenu_file = 'themes.php'; |
|
30 |
} |
|
31 |
||
32 |
$installed_themes = search_theme_directories(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
33 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
34 |
if ( false === $installed_themes ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
$installed_themes = array(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
37 |
|
19 | 38 |
foreach ( $installed_themes as $theme_slug => $theme_data ) { |
39 |
// Ignore child themes. |
|
40 |
if ( str_contains( $theme_slug, '/' ) ) { |
|
41 |
unset( $installed_themes[ $theme_slug ] ); |
|
5 | 42 |
} |
43 |
} |
|
0 | 44 |
|
9 | 45 |
wp_localize_script( |
46 |
'theme', |
|
47 |
'_wpThemeSettings', |
|
48 |
array( |
|
49 |
'themes' => false, |
|
50 |
'settings' => array( |
|
51 |
'isInstall' => true, |
|
52 |
'canInstall' => current_user_can( 'install_themes' ), |
|
53 |
'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null, |
|
54 |
'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
|
55 |
), |
9 | 56 |
'l10n' => array( |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
57 |
'addNew' => __( 'Add Theme' ), |
9 | 58 |
'search' => __( 'Search Themes' ), |
59 |
'upload' => __( 'Upload Theme' ), |
|
60 |
'back' => __( 'Back' ), |
|
61 |
'error' => sprintf( |
|
16 | 62 |
/* translators: %s: Support forums URL. */ |
9 | 63 |
__( '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>.' ), |
16 | 64 |
__( 'https://wordpress.org/support/forums/' ) |
9 | 65 |
), |
66 |
'tryAgain' => __( 'Try Again' ), |
|
16 | 67 |
/* translators: %d: Number of themes. */ |
9 | 68 |
'themesFound' => __( 'Number of Themes found: %d' ), |
69 |
'noThemesFound' => __( 'No themes found. Try a different search.' ), |
|
70 |
'collapseSidebar' => __( 'Collapse Sidebar' ), |
|
71 |
'expandSidebar' => __( 'Expand Sidebar' ), |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
72 |
/* translators: Hidden accessibility text. */ |
9 | 73 |
'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ), |
74 |
), |
|
75 |
'installedThemes' => array_keys( $installed_themes ), |
|
16 | 76 |
'activeTheme' => get_stylesheet(), |
9 | 77 |
) |
78 |
); |
|
0 | 79 |
|
80 |
wp_enqueue_script( 'theme' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
81 |
wp_enqueue_script( 'updates' ); |
0 | 82 |
|
5 | 83 |
if ( $tab ) { |
84 |
/** |
|
85 |
* Fires before each of the tabs are rendered on the Install Themes page. |
|
86 |
* |
|
87 |
* The dynamic portion of the hook name, `$tab`, refers to the current |
|
18 | 88 |
* theme installation tab. |
89 |
* |
|
90 |
* Possible hook names include: |
|
91 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
92 |
* - `install_themes_pre_block-themes` |
18 | 93 |
* - `install_themes_pre_dashboard` |
94 |
* - `install_themes_pre_featured` |
|
95 |
* - `install_themes_pre_new` |
|
96 |
* - `install_themes_pre_search` |
|
97 |
* - `install_themes_pre_updated` |
|
98 |
* - `install_themes_pre_upload` |
|
5 | 99 |
* |
100 |
* @since 2.8.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
101 |
* @since 6.1.0 Added the `install_themes_pre_block-themes` hook name. |
5 | 102 |
*/ |
103 |
do_action( "install_themes_pre_{$tab}" ); |
|
104 |
} |
|
0 | 105 |
|
106 |
$help_overview = |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
107 |
'<p>' . sprintf( |
16 | 108 |
/* translators: %s: Theme Directory URL. */ |
109 |
__( '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 | 110 |
__( 'https://wordpress.org/themes/' ) |
111 |
) . '</p>' . |
|
5 | 112 |
'<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>' . |
18 | 113 |
'<p>' . __( 'Alternately, you can browse the themes that are 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
|
114 |
'<p>' . sprintf( |
9 | 115 |
/* translators: %s: /wp-content/themes */ |
16 | 116 |
__( '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 | 117 |
'<code>/wp-content/themes</code>' |
118 |
) . '</p>'; |
|
0 | 119 |
|
9 | 120 |
get_current_screen()->add_help_tab( |
121 |
array( |
|
122 |
'id' => 'overview', |
|
123 |
'title' => __( 'Overview' ), |
|
124 |
'content' => $help_overview, |
|
125 |
) |
|
126 |
); |
|
0 | 127 |
|
128 |
$help_installing = |
|
19 | 129 |
'<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 are 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>' . |
9 | 130 |
'<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 | 131 |
|
9 | 132 |
get_current_screen()->add_help_tab( |
133 |
array( |
|
134 |
'id' => 'installing', |
|
135 |
'title' => __( 'Previewing and Installing' ), |
|
136 |
'content' => $help_installing, |
|
137 |
) |
|
138 |
); |
|
0 | 139 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
140 |
// Help tab: Block themes. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
141 |
$help_block_themes = |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
142 |
'<p>' . __( 'A block theme is a theme that uses blocks for all parts of a site including navigation menus, header, content, and site footer. These themes are built for the features that allow you to edit and customize all parts of your site.' ) . '</p>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
143 |
'<p>' . __( 'With a block theme, you can place and edit blocks without affecting your content by customizing or creating new templates.' ) . '</p>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
144 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
145 |
get_current_screen()->add_help_tab( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
146 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
147 |
'id' => 'block_themes', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
148 |
'title' => __( 'Block themes' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
149 |
'content' => $help_block_themes, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
150 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
151 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
152 |
|
0 | 153 |
get_current_screen()->set_help_sidebar( |
9 | 154 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
155 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-themes-screen/#install-themes">Documentation on Adding New Themes</a>' ) . '</p>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
156 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/block-themes/">Documentation on Block Themes</a>' ) . '</p>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
157 |
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' |
0 | 158 |
); |
159 |
||
16 | 160 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
5 | 161 |
|
0 | 162 |
?> |
163 |
<div class="wrap"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
164 |
<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
|
165 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
166 |
<?php |
5 | 167 |
|
168 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
169 |
* Filters the tabs shown on the Add Themes screen. |
5 | 170 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
171 |
* This filter is for backward compatibility only, for the suppression of the upload tab. |
5 | 172 |
* |
173 |
* @since 2.8.0 |
|
174 |
* |
|
9 | 175 |
* @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'. |
5 | 176 |
*/ |
177 |
$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) ); |
|
178 |
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
|
179 |
echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>'; |
5 | 180 |
} |
7
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 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
183 |
<hr class="wp-header-end"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
184 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
185 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
186 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
187 |
__( 'The Theme Installer screen requires JavaScript.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
188 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
189 |
'additional_classes' => array( 'error', 'hide-if-js' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
190 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
191 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
192 |
?> |
5 | 193 |
|
194 |
<div class="upload-theme"> |
|
195 |
<?php install_themes_upload(); ?> |
|
196 |
</div> |
|
197 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
198 |
<h2 class="screen-reader-text hide-if-no-js"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
199 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
200 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
201 |
_e( 'Filter themes list' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
202 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
203 |
</h2> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
204 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
205 |
<div class="wp-filter hide-if-no-js"> |
5 | 206 |
<div class="filter-count"> |
207 |
<span class="count theme-count"></span> |
|
208 |
</div> |
|
209 |
||
210 |
<ul class="filter-links"> |
|
211 |
<li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li> |
|
212 |
<li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
213 |
<li><a href="#" data-sort="block-themes"><?php _ex( 'Block Themes', 'themes' ); ?></a></li> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
214 |
<li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li> |
5 | 215 |
</ul> |
216 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
217 |
<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
|
218 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
219 |
<form class="search-form"><p class="search-box"></p></form> |
5 | 220 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
221 |
<div class="favorites-form"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
222 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
223 |
$action = 'save_wporg_username_' . get_current_user_id(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
224 |
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
|
225 |
$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
|
226 |
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
|
227 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
228 |
$user = get_user_option( 'wporg_favorites' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
229 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
230 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
231 |
<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
|
232 |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
233 |
<p class="favorites-username"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
234 |
<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
|
235 |
<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
|
236 |
<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
|
237 |
<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
|
238 |
</p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
239 |
</div> |
5 | 240 |
|
241 |
<div class="filter-drawer"> |
|
242 |
<div class="buttons"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
243 |
<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
|
244 |
<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button> |
5 | 245 |
</div> |
246 |
<?php |
|
16 | 247 |
// Use the core list, rather than the .org API, due to inconsistencies |
248 |
// and to ensure tags are translated. |
|
249 |
$feature_list = get_theme_feature_list( false ); |
|
250 |
||
19 | 251 |
foreach ( $feature_list as $feature_group => $features ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
252 |
echo '<fieldset class="filter-group">'; |
19 | 253 |
echo '<legend>' . esc_html( $feature_group ) . '</legend>'; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
254 |
echo '<div class="filter-group-feature">'; |
5 | 255 |
foreach ( $features as $feature => $feature_name ) { |
256 |
$feature = esc_attr( $feature ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
257 |
echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> '; |
19 | 258 |
echo '<label for="filter-id-' . $feature . '">' . esc_html( $feature_name ) . '</label>'; |
5 | 259 |
} |
260 |
echo '</div>'; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
261 |
echo '</fieldset>'; |
5 | 262 |
} |
263 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
264 |
<div class="buttons"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
265 |
<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
|
266 |
<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
|
267 |
</div> |
5 | 268 |
<div class="filtered-by"> |
269 |
<span><?php _e( 'Filtering by:' ); ?></span> |
|
270 |
<div class="tags"></div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
271 |
<button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button> |
5 | 272 |
</div> |
273 |
</div> |
|
274 |
</div> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
275 |
<h2 class="screen-reader-text hide-if-no-js"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
276 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
277 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
278 |
_e( 'Themes list' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
279 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
280 |
</h2> |
5 | 281 |
<div class="theme-browser content-filterable"></div> |
282 |
<div class="theme-install-overlay wp-full-overlay expanded"></div> |
|
283 |
||
284 |
<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> |
|
285 |
<span class="spinner"></span> |
|
0 | 286 |
|
5 | 287 |
<?php |
288 |
if ( $tab ) { |
|
289 |
/** |
|
290 |
* Fires at the top of each of the tabs on the Install Themes page. |
|
291 |
* |
|
292 |
* The dynamic portion of the hook name, `$tab`, refers to the current |
|
18 | 293 |
* theme installation tab. |
294 |
* |
|
295 |
* Possible hook names include: |
|
296 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
297 |
* - `install_themes_block-themes` |
18 | 298 |
* - `install_themes_dashboard` |
299 |
* - `install_themes_featured` |
|
300 |
* - `install_themes_new` |
|
301 |
* - `install_themes_search` |
|
302 |
* - `install_themes_updated` |
|
303 |
* - `install_themes_upload` |
|
5 | 304 |
* |
305 |
* @since 2.8.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
306 |
* @since 6.1.0 Added the `install_themes_block-themes` hook name. |
5 | 307 |
* |
308 |
* @param int $paged Number of the current page of results being viewed. |
|
309 |
*/ |
|
310 |
do_action( "install_themes_{$tab}", $paged ); |
|
311 |
} |
|
312 |
?> |
|
313 |
</div> |
|
314 |
||
315 |
<script id="tmpl-theme" type="text/template"> |
|
316 |
<# if ( data.screenshot_url ) { #> |
|
317 |
<div class="theme-screenshot"> |
|
19 | 318 |
<img src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" /> |
5 | 319 |
</div> |
320 |
<# } else { #> |
|
321 |
<div class="theme-screenshot blank"></div> |
|
322 |
<# } #> |
|
16 | 323 |
|
324 |
<# if ( data.installed ) { #> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
325 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
326 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
327 |
_x( 'Installed', 'theme' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
328 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
329 |
'type' => 'success', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
330 |
'additional_classes' => array( 'notice-alt' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
331 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
332 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
333 |
?> |
16 | 334 |
<# } #> |
335 |
||
336 |
<# if ( ! data.compatible_wp || ! data.compatible_php ) { #> |
|
337 |
<div class="notice notice-error notice-alt"><p> |
|
338 |
<# if ( ! data.compatible_wp && ! data.compatible_php ) { #> |
|
339 |
<?php |
|
19 | 340 |
_e( 'This theme does not work with your versions of WordPress and PHP.' ); |
16 | 341 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
342 |
printf( |
|
343 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
344 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
345 |
self_admin_url( 'update-core.php' ), |
|
346 |
esc_url( wp_get_update_php_url() ) |
|
347 |
); |
|
348 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
349 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
350 |
printf( |
|
351 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
352 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
353 |
self_admin_url( 'update-core.php' ) |
|
354 |
); |
|
355 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
356 |
printf( |
|
357 |
/* translators: %s: URL to Update PHP page. */ |
|
358 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
359 |
esc_url( wp_get_update_php_url() ) |
|
360 |
); |
|
361 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
362 |
} |
|
363 |
?> |
|
364 |
<# } else if ( ! data.compatible_wp ) { #> |
|
365 |
<?php |
|
19 | 366 |
_e( 'This theme does not work with your version of WordPress.' ); |
16 | 367 |
if ( current_user_can( 'update_core' ) ) { |
368 |
printf( |
|
369 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
370 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
371 |
self_admin_url( 'update-core.php' ) |
|
372 |
); |
|
373 |
} |
|
374 |
?> |
|
375 |
<# } else if ( ! data.compatible_php ) { #> |
|
376 |
<?php |
|
19 | 377 |
_e( 'This theme does not work with your version of PHP.' ); |
16 | 378 |
if ( current_user_can( 'update_php' ) ) { |
379 |
printf( |
|
380 |
/* translators: %s: URL to Update PHP page. */ |
|
381 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
382 |
esc_url( wp_get_update_php_url() ) |
|
383 |
); |
|
384 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
385 |
} |
|
386 |
?> |
|
387 |
<# } #> |
|
388 |
</p></div> |
|
389 |
<# } #> |
|
390 |
||
5 | 391 |
<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
|
392 |
<div class="theme-author"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
393 |
<?php |
16 | 394 |
/* translators: %s: Theme author name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
395 |
printf( __( 'By %s' ), '{{ data.author }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
396 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
397 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
398 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
399 |
<div class="theme-id-container"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
400 |
<h3 class="theme-name">{{ data.name }}</h3> |
5 | 401 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
402 |
<div class="theme-actions"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
403 |
<# if ( data.installed ) { #> |
16 | 404 |
<# if ( data.compatible_wp && data.compatible_php ) { #> |
405 |
<?php |
|
406 |
/* translators: %s: Theme name. */ |
|
407 |
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
|
408 |
?> |
|
409 |
<# if ( data.activate_url ) { #> |
|
410 |
<# if ( ! data.active ) { #> |
|
411 |
<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> |
|
412 |
<# } else { #> |
|
413 |
<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button> |
|
414 |
<# } #> |
|
415 |
<# } #> |
|
416 |
<# if ( data.customize_url ) { #> |
|
417 |
<# if ( ! data.active ) { #> |
|
19 | 418 |
<# if ( ! data.block_theme ) { #> |
419 |
<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a> |
|
420 |
<# } #> |
|
16 | 421 |
<# } else { #> |
422 |
<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a> |
|
423 |
<# } #> |
|
424 |
<# } else { #> |
|
425 |
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
|
426 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
427 |
<# } else { #> |
16 | 428 |
<?php |
429 |
/* translators: %s: Theme name. */ |
|
430 |
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); |
|
431 |
?> |
|
432 |
<# if ( data.activate_url ) { #> |
|
433 |
<a class="button button-primary disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> |
|
434 |
<# } #> |
|
435 |
<# if ( data.customize_url ) { #> |
|
436 |
<a class="button disabled"><?php _e( 'Live Preview' ); ?></a> |
|
437 |
<# } else { #> |
|
438 |
<button class="button disabled"><?php _e( 'Preview' ); ?></button> |
|
439 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
440 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
441 |
<# } else { #> |
16 | 442 |
<# if ( data.compatible_wp && data.compatible_php ) { #> |
443 |
<?php |
|
444 |
/* translators: %s: Theme name. */ |
|
445 |
$aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' ); |
|
446 |
?> |
|
447 |
<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> |
|
448 |
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> |
|
449 |
<# } else { #> |
|
450 |
<?php |
|
451 |
/* translators: %s: Theme name. */ |
|
452 |
$aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' ); |
|
453 |
?> |
|
454 |
<a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a> |
|
455 |
<button class="button disabled"><?php _e( 'Preview' ); ?></button> |
|
456 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
457 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
458 |
</div> |
5 | 459 |
</div> |
460 |
</script> |
|
461 |
||
462 |
<script id="tmpl-theme-preview" type="text/template"> |
|
463 |
<div class="wp-full-overlay-sidebar"> |
|
464 |
<div class="wp-full-overlay-header"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
465 |
<button class="close-full-overlay"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
466 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
467 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
468 |
_e( 'Close' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
469 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
470 |
</span></button> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
471 |
<button class="previous-theme"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
472 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
473 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
474 |
_e( 'Previous theme' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
475 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
476 |
</span></button> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
477 |
<button class="next-theme"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
478 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
479 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
480 |
_e( 'Next theme' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
481 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
482 |
</span></button> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
483 |
<# if ( data.installed ) { #> |
16 | 484 |
<# if ( data.compatible_wp && data.compatible_php ) { #> |
485 |
<?php |
|
486 |
/* translators: %s: Theme name. */ |
|
487 |
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
|
488 |
?> |
|
489 |
<# if ( ! data.active ) { #> |
|
490 |
<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> |
|
491 |
<# } else { #> |
|
492 |
<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button> |
|
493 |
<# } #> |
|
494 |
<# } else { #> |
|
495 |
<a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> |
|
496 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
497 |
<# } else { #> |
16 | 498 |
<# if ( data.compatible_wp && data.compatible_php ) { #> |
499 |
<a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a> |
|
500 |
<# } else { #> |
|
501 |
<a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a> |
|
502 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
503 |
<# } #> |
5 | 504 |
</div> |
505 |
<div class="wp-full-overlay-sidebar-content"> |
|
506 |
<div class="install-theme-info"> |
|
507 |
<h3 class="theme-name">{{ data.name }}</h3> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
508 |
<span class="theme-by"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
509 |
<?php |
16 | 510 |
/* translators: %s: Theme author name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
511 |
printf( __( 'By %s' ), '{{ data.author }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
512 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
513 |
</span> |
5 | 514 |
|
19 | 515 |
<div class="theme-screenshot"> |
516 |
<img class="theme-screenshot" src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" /> |
|
517 |
</div> |
|
5 | 518 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
519 |
<div class="theme-details"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
520 |
<# if ( data.rating ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
521 |
<div class="theme-rating"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
522 |
{{{ data.stars }}} |
9 | 523 |
<a class="num-ratings" href="{{ data.reviews_url }}"> |
524 |
<?php |
|
16 | 525 |
/* translators: %s: Number of ratings. */ |
526 |
printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ); |
|
9 | 527 |
?> |
528 |
</a> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
529 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
530 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
531 |
<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
|
532 |
<# } #> |
16 | 533 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
534 |
<div class="theme-version"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
535 |
<?php |
16 | 536 |
/* translators: %s: Theme version. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
537 |
printf( __( 'Version: %s' ), '{{ data.version }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
538 |
?> |
5 | 539 |
</div> |
16 | 540 |
|
541 |
<# if ( ! data.compatible_wp || ! data.compatible_php ) { #> |
|
542 |
<div class="notice notice-error notice-alt notice-large"><p> |
|
543 |
<# if ( ! data.compatible_wp && ! data.compatible_php ) { #> |
|
544 |
<?php |
|
19 | 545 |
_e( 'This theme does not work with your versions of WordPress and PHP.' ); |
16 | 546 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
547 |
printf( |
|
548 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
549 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
550 |
self_admin_url( 'update-core.php' ), |
|
551 |
esc_url( wp_get_update_php_url() ) |
|
552 |
); |
|
553 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
554 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
555 |
printf( |
|
556 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
557 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
558 |
self_admin_url( 'update-core.php' ) |
|
559 |
); |
|
560 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
561 |
printf( |
|
562 |
/* translators: %s: URL to Update PHP page. */ |
|
563 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
564 |
esc_url( wp_get_update_php_url() ) |
|
565 |
); |
|
566 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
567 |
} |
|
568 |
?> |
|
569 |
<# } else if ( ! data.compatible_wp ) { #> |
|
570 |
<?php |
|
19 | 571 |
_e( 'This theme does not work with your version of WordPress.' ); |
16 | 572 |
if ( current_user_can( 'update_core' ) ) { |
573 |
printf( |
|
574 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
575 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
576 |
self_admin_url( 'update-core.php' ) |
|
577 |
); |
|
578 |
} |
|
579 |
?> |
|
580 |
<# } else if ( ! data.compatible_php ) { #> |
|
581 |
<?php |
|
19 | 582 |
_e( 'This theme does not work with your version of PHP.' ); |
16 | 583 |
if ( current_user_can( 'update_php' ) ) { |
584 |
printf( |
|
585 |
/* translators: %s: URL to Update PHP page. */ |
|
586 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
587 |
esc_url( wp_get_update_php_url() ) |
|
588 |
); |
|
589 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
590 |
} |
|
591 |
?> |
|
592 |
<# } #> |
|
593 |
</p></div> |
|
594 |
<# } #> |
|
595 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
596 |
<div class="theme-description">{{{ data.description }}}</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
597 |
</div> |
5 | 598 |
</div> |
599 |
</div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
600 |
<div class="wp-full-overlay-footer"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
601 |
<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
|
602 |
<span class="collapse-sidebar-arrow"></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
603 |
<span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
604 |
</button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
605 |
</div> |
5 | 606 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
607 |
<div class="wp-full-overlay-main"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
608 |
<iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe> |
5 | 609 |
</div> |
610 |
</script> |
|
0 | 611 |
|
612 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
613 |
wp_print_request_filesystem_credentials_modal(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
614 |
wp_print_admin_notice_templates(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
615 |
|
16 | 616 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |