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 |
* Themes administration panel. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** WordPress Administration Bootstrap */ |
|
16 | 10 |
require_once __DIR__ . '/admin.php'; |
0 | 11 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
12 |
if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
13 |
wp_die( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
14 |
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
15 |
'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
16 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
17 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
18 |
} |
0 | 19 |
|
9 | 20 |
if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) { |
16 | 21 |
if ( 'activate' === $_GET['action'] ) { |
9 | 22 |
check_admin_referer( 'switch-theme_' . $_GET['stylesheet'] ); |
0 | 23 |
$theme = wp_get_theme( $_GET['stylesheet'] ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
24 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
25 |
if ( ! $theme->exists() || ! $theme->is_allowed() ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
26 |
wp_die( |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
27 |
'<h1>' . __( 'An error occurred.' ) . '</h1>' . |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
28 |
'<p>' . __( 'The requested theme does not exist.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
30 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
31 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
32 |
|
0 | 33 |
switch_theme( $theme->get_stylesheet() ); |
9 | 34 |
wp_redirect( admin_url( 'themes.php?activated=true' ) ); |
35 |
exit; |
|
36 |
} elseif ( 'resume' === $_GET['action'] ) { |
|
37 |
check_admin_referer( 'resume-theme_' . $_GET['stylesheet'] ); |
|
38 |
$theme = wp_get_theme( $_GET['stylesheet'] ); |
|
39 |
||
40 |
if ( ! current_user_can( 'resume_theme', $_GET['stylesheet'] ) ) { |
|
41 |
wp_die( |
|
42 |
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . |
|
43 |
'<p>' . __( 'Sorry, you are not allowed to resume this theme.' ) . '</p>', |
|
44 |
403 |
|
45 |
); |
|
46 |
} |
|
47 |
||
48 |
$result = resume_theme( $theme->get_stylesheet(), self_admin_url( 'themes.php?error=resuming' ) ); |
|
49 |
||
50 |
if ( is_wp_error( $result ) ) { |
|
51 |
wp_die( $result ); |
|
52 |
} |
|
53 |
||
54 |
wp_redirect( admin_url( 'themes.php?resumed=true' ) ); |
|
0 | 55 |
exit; |
16 | 56 |
} elseif ( 'delete' === $_GET['action'] ) { |
9 | 57 |
check_admin_referer( 'delete-theme_' . $_GET['stylesheet'] ); |
0 | 58 |
$theme = wp_get_theme( $_GET['stylesheet'] ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
60 |
if ( ! current_user_can( 'delete_themes' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
61 |
wp_die( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
62 |
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
63 |
'<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
64 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
65 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
66 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
67 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
68 |
if ( ! $theme->exists() ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
69 |
wp_die( |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
70 |
'<h1>' . __( 'An error occurred while deleting the theme.' ) . '</h1>' . |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
71 |
'<p>' . __( 'The requested theme does not exist.' ) . '</p>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
72 |
403 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
73 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
74 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
75 |
|
5 | 76 |
$active = wp_get_theme(); |
19 | 77 |
if ( $active->get( 'Template' ) === $_GET['stylesheet'] ) { |
5 | 78 |
wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) ); |
79 |
} else { |
|
80 |
delete_theme( $_GET['stylesheet'] ); |
|
81 |
wp_redirect( admin_url( 'themes.php?deleted=true' ) ); |
|
82 |
} |
|
0 | 83 |
exit; |
16 | 84 |
} elseif ( 'enable-auto-update' === $_GET['action'] ) { |
85 |
if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { |
|
86 |
wp_die( __( 'Sorry, you are not allowed to enable themes automatic updates.' ) ); |
|
87 |
} |
|
88 |
||
89 |
check_admin_referer( 'updates' ); |
|
90 |
||
91 |
$all_items = wp_get_themes(); |
|
92 |
$auto_updates = (array) get_site_option( 'auto_update_themes', array() ); |
|
93 |
||
94 |
$auto_updates[] = $_GET['stylesheet']; |
|
95 |
$auto_updates = array_unique( $auto_updates ); |
|
96 |
// Remove themes that have been deleted since the site option was last updated. |
|
97 |
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) ); |
|
98 |
||
99 |
update_site_option( 'auto_update_themes', $auto_updates ); |
|
100 |
||
101 |
wp_redirect( admin_url( 'themes.php?enabled-auto-update=true' ) ); |
|
102 |
||
103 |
exit; |
|
104 |
} elseif ( 'disable-auto-update' === $_GET['action'] ) { |
|
105 |
if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { |
|
106 |
wp_die( __( 'Sorry, you are not allowed to disable themes automatic updates.' ) ); |
|
107 |
} |
|
108 |
||
109 |
check_admin_referer( 'updates' ); |
|
110 |
||
111 |
$all_items = wp_get_themes(); |
|
112 |
$auto_updates = (array) get_site_option( 'auto_update_themes', array() ); |
|
113 |
||
114 |
$auto_updates = array_diff( $auto_updates, array( $_GET['stylesheet'] ) ); |
|
115 |
// Remove themes that have been deleted since the site option was last updated. |
|
116 |
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) ); |
|
117 |
||
118 |
update_site_option( 'auto_update_themes', $auto_updates ); |
|
119 |
||
120 |
wp_redirect( admin_url( 'themes.php?disabled-auto-update=true' ) ); |
|
121 |
||
122 |
exit; |
|
0 | 123 |
} |
124 |
} |
|
125 |
||
19 | 126 |
// Used in the HTML title tag. |
127 |
$title = __( 'Themes' ); |
|
0 | 128 |
$parent_file = 'themes.php'; |
129 |
||
16 | 130 |
// Help tab: Overview. |
5 | 131 |
if ( current_user_can( 'switch_themes' ) ) { |
9 | 132 |
$help_overview = '<p>' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '</p>' . |
5 | 133 |
'<p>' . __( 'From this screen you can:' ) . '</p>' . |
134 |
'<ul><li>' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '</li>' . |
|
135 |
'<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' . |
|
19 | 136 |
'<li>' . __( 'Click Customize for the active theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' . |
137 |
'<p>' . __( 'The active theme is displayed highlighted as the first theme.' ) . '</p>' . |
|
5 | 138 |
'<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>'; |
0 | 139 |
|
9 | 140 |
get_current_screen()->add_help_tab( |
141 |
array( |
|
142 |
'id' => 'overview', |
|
143 |
'title' => __( 'Overview' ), |
|
144 |
'content' => $help_overview, |
|
145 |
) |
|
146 |
); |
|
16 | 147 |
} // End if 'switch_themes'. |
0 | 148 |
|
16 | 149 |
// Help tab: Adding Themes. |
0 | 150 |
if ( current_user_can( 'install_themes' ) ) { |
151 |
if ( is_multisite() ) { |
|
9 | 152 |
$help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>'; |
0 | 153 |
} else { |
16 | 154 |
$help_install = '<p>' . sprintf( |
155 |
/* translators: %s: https://wordpress.org/themes/ */ |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
156 |
__( 'If you would like to see more themes to choose from, click on the “Add Theme” button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they are free!' ), |
16 | 157 |
__( 'https://wordpress.org/themes/' ) |
158 |
) . '</p>'; |
|
0 | 159 |
} |
160 |
||
9 | 161 |
get_current_screen()->add_help_tab( |
162 |
array( |
|
163 |
'id' => 'adding-themes', |
|
164 |
'title' => __( 'Adding Themes' ), |
|
165 |
'content' => $help_install, |
|
166 |
) |
|
167 |
); |
|
16 | 168 |
} // End if 'install_themes'. |
0 | 169 |
|
16 | 170 |
// Help tab: Previewing and Customizing. |
5 | 171 |
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { |
0 | 172 |
$help_customize = |
9 | 173 |
'<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>' . |
18 | 174 |
'<p>' . __( 'The theme being previewed is fully interactive — navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Activate & Publish button above the menu.' ) . '</p>' . |
5 | 175 |
'<p>' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '</p>'; |
0 | 176 |
|
9 | 177 |
get_current_screen()->add_help_tab( |
178 |
array( |
|
179 |
'id' => 'customize-preview-themes', |
|
180 |
'title' => __( 'Previewing and Customizing' ), |
|
181 |
'content' => $help_customize, |
|
182 |
) |
|
183 |
); |
|
16 | 184 |
} // End if 'edit_theme_options' && 'customize'. |
185 |
||
186 |
$help_sidebar_autoupdates = ''; |
|
187 |
||
188 |
// Help tab: Auto-updates. |
|
189 |
if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) { |
|
190 |
$help_tab_autoupdates = |
|
191 |
'<p>' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' . |
|
192 |
'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>'; |
|
193 |
||
194 |
get_current_screen()->add_help_tab( |
|
195 |
array( |
|
196 |
'id' => 'plugins-themes-auto-updates', |
|
197 |
'title' => __( 'Auto-updates' ), |
|
198 |
'content' => $help_tab_autoupdates, |
|
199 |
) |
|
200 |
); |
|
201 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
202 |
$help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-themes-auto-updates/">Documentation on Auto-updates</a>' ) . '</p>'; |
16 | 203 |
} // End if 'update_themes' && 'wp_is_auto_update_enabled_for_type'. |
0 | 204 |
|
205 |
get_current_screen()->set_help_sidebar( |
|
5 | 206 |
'<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
|
207 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/work-with-themes/">Documentation on Using Themes</a>' ) . '</p>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
208 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-themes-screen/">Documentation on Managing Themes</a>' ) . '</p>' . |
16 | 209 |
$help_sidebar_autoupdates . |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
210 |
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' |
0 | 211 |
); |
212 |
||
5 | 213 |
if ( current_user_can( 'switch_themes' ) ) { |
214 |
$themes = wp_prepare_themes_for_js(); |
|
215 |
} else { |
|
216 |
$themes = wp_prepare_themes_for_js( array( wp_get_theme() ) ); |
|
217 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
218 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
219 |
$theme = ! empty( $_REQUEST['theme'] ) ? sanitize_text_field( $_REQUEST['theme'] ) : ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
220 |
$search = ! empty( $_REQUEST['search'] ) ? sanitize_text_field( $_REQUEST['search'] ) : ''; |
5 | 221 |
|
9 | 222 |
wp_localize_script( |
223 |
'theme', |
|
224 |
'_wpThemeSettings', |
|
225 |
array( |
|
226 |
'themes' => $themes, |
|
227 |
'settings' => array( |
|
228 |
'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ), |
|
229 |
'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null, |
|
230 |
'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ), |
|
231 |
'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), |
|
232 |
), |
|
233 |
'l10n' => array( |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
234 |
'addNew' => __( 'Add Theme' ), |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
235 |
'search' => __( 'Search installed themes' ), |
16 | 236 |
/* translators: %d: Number of themes. */ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
237 |
'themesFound' => __( 'Number of Themes found: %d' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
238 |
'noThemesFound' => __( 'No themes found. Try a different search.' ), |
9 | 239 |
), |
240 |
) |
|
241 |
); |
|
5 | 242 |
|
243 |
add_thickbox(); |
|
0 | 244 |
wp_enqueue_script( 'theme' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
245 |
wp_enqueue_script( 'updates' ); |
0 | 246 |
|
16 | 247 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 248 |
?> |
249 |
||
5 | 250 |
<div class="wrap"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
251 |
<h1 class="wp-heading-inline"><?php esc_html_e( 'Themes' ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
252 |
<span class="title-count theme-count"><?php echo ! empty( $_GET['search'] ) ? __( '…' ) : count( $themes ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
253 |
</h1> |
5 | 254 |
<?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
255 |
<a href="<?php echo esc_url( admin_url( 'theme-install.php' ) ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html__( 'Add Theme' ); ?></a> |
5 | 256 |
<?php endif; ?> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
257 |
<hr class="wp-header-end"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
258 |
<form class="search-form search-themes"><p class="search-box"></p></form> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
259 |
|
0 | 260 |
<?php |
9 | 261 |
if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
262 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
263 |
__( 'The active theme is broken. Reverting to the default theme.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
264 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
265 |
'id' => 'message1', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
266 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
267 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
268 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
269 |
); |
9 | 270 |
} elseif ( isset( $_GET['activated'] ) ) { |
271 |
if ( isset( $_GET['previewed'] ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
272 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
273 |
__( 'Settings saved and theme activated.' ) . ' <a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
274 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
275 |
'id' => 'message2', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
276 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
277 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
278 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
279 |
); |
9 | 280 |
} else { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
281 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
282 |
__( 'New theme activated.' ) . ' <a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
283 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
284 |
'id' => 'message2', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
285 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
286 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
287 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
288 |
); |
9 | 289 |
} |
290 |
} elseif ( isset( $_GET['deleted'] ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
291 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
292 |
__( 'Theme deleted.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
293 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
294 |
'id' => 'message3', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
295 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
296 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
297 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
298 |
); |
9 | 299 |
} elseif ( isset( $_GET['delete-active-child'] ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
300 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
301 |
__( 'You cannot delete a theme while it has an active child theme.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
302 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
303 |
'id' => 'message4', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
304 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
305 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
306 |
); |
9 | 307 |
} elseif ( isset( $_GET['resumed'] ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
308 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
309 |
__( 'Theme resumed.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
310 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
311 |
'id' => 'message5', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
312 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
313 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
314 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
315 |
); |
9 | 316 |
} elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
317 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
318 |
__( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
319 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
320 |
'id' => 'message6', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
321 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
322 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
323 |
); |
16 | 324 |
} elseif ( isset( $_GET['enabled-auto-update'] ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
325 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
326 |
__( 'Theme will be auto-updated.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
327 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
328 |
'id' => 'message7', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
329 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
330 |
'dismissible' => true, |
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 |
); |
16 | 333 |
} elseif ( isset( $_GET['disabled-auto-update'] ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
334 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
335 |
__( 'Theme will no longer be auto-updated.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
336 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
337 |
'id' => 'message8', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
338 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
339 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
340 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
341 |
); |
9 | 342 |
} |
0 | 343 |
|
18 | 344 |
$current_theme = wp_get_theme(); |
0 | 345 |
|
18 | 346 |
if ( $current_theme->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
347 |
wp_admin_notice( |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
348 |
'<strong>' . __( 'Error:' ) . '</strong> ' . $current_theme->errors()->get_error_message(), |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
349 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
350 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
351 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
352 |
); |
0 | 353 |
} |
354 |
||
18 | 355 |
$current_theme_actions = array(); |
0 | 356 |
|
9 | 357 |
if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { |
19 | 358 |
$forbidden_paths = array( |
359 |
'themes.php', |
|
360 |
'theme-editor.php', |
|
361 |
'site-editor.php', |
|
362 |
'edit.php?post_type=wp_navigation', |
|
363 |
); |
|
364 |
||
9 | 365 |
foreach ( (array) $submenu['themes.php'] as $item ) { |
366 |
$class = ''; |
|
19 | 367 |
|
368 |
if ( in_array( $item[2], $forbidden_paths, true ) || str_starts_with( $item[2], 'customize.php' ) ) { |
|
9 | 369 |
continue; |
370 |
} |
|
19 | 371 |
|
16 | 372 |
// 0 = name, 1 = capability, 2 = file. |
19 | 373 |
if ( 0 === strcmp( $self, $item[2] ) && empty( $parent_file ) |
374 |
|| $parent_file && $item[2] === $parent_file |
|
375 |
) { |
|
9 | 376 |
$class = ' current'; |
377 |
} |
|
19 | 378 |
|
9 | 379 |
if ( ! empty( $submenu[ $item[2] ] ) ) { |
380 |
$submenu[ $item[2] ] = array_values( $submenu[ $item[2] ] ); // Re-index. |
|
381 |
$menu_hook = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] ); |
|
19 | 382 |
|
9 | 383 |
if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) { |
384 |
$current_theme_actions[] = "<a class='button$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
|
385 |
} else { |
|
386 |
$current_theme_actions[] = "<a class='button$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; |
|
387 |
} |
|
388 |
} elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { |
|
389 |
$menu_file = $item[2]; |
|
5 | 390 |
|
9 | 391 |
if ( current_user_can( 'customize' ) ) { |
392 |
if ( 'custom-header' === $menu_file ) { |
|
393 |
$current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>"; |
|
394 |
} elseif ( 'custom-background' === $menu_file ) { |
|
395 |
$current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>"; |
|
5 | 396 |
} |
9 | 397 |
} |
5 | 398 |
|
16 | 399 |
$pos = strpos( $menu_file, '?' ); |
400 |
if ( false !== $pos ) { |
|
9 | 401 |
$menu_file = substr( $menu_file, 0, $pos ); |
402 |
} |
|
5 | 403 |
|
9 | 404 |
if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) { |
405 |
$current_theme_actions[] = "<a class='button$class' href='{$item[2]}'>{$item[0]}</a>"; |
|
406 |
} else { |
|
407 |
$current_theme_actions[] = "<a class='button$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>"; |
|
0 | 408 |
} |
409 |
} |
|
410 |
} |
|
9 | 411 |
} |
0 | 412 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
413 |
$class_name = 'theme-browser'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
414 |
if ( ! empty( $_GET['search'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
415 |
$class_name .= ' search-loading'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
416 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
417 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
418 |
<div class="<?php echo esc_attr( $class_name ); ?>"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
419 |
<div class="themes wp-clearfix"> |
0 | 420 |
|
5 | 421 |
<?php |
422 |
/* |
|
423 |
* This PHP is synchronized with the tmpl-theme template below! |
|
424 |
*/ |
|
0 | 425 |
|
5 | 426 |
foreach ( $themes as $theme ) : |
19 | 427 |
$aria_action = $theme['id'] . '-action'; |
428 |
$aria_name = $theme['id'] . '-name'; |
|
9 | 429 |
|
430 |
$active_class = ''; |
|
431 |
if ( $theme['active'] ) { |
|
432 |
$active_class = ' active'; |
|
433 |
} |
|
5 | 434 |
?> |
18 | 435 |
<div class="theme<?php echo $active_class; ?>"> |
5 | 436 |
<?php if ( ! empty( $theme['screenshot'][0] ) ) { ?> |
437 |
<div class="theme-screenshot"> |
|
19 | 438 |
<img src="<?php echo esc_url( $theme['screenshot'][0] . '?ver=' . $theme['version'] ); ?>" alt="" /> |
5 | 439 |
</div> |
440 |
<?php } else { ?> |
|
441 |
<div class="theme-screenshot blank"></div> |
|
442 |
<?php } ?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
443 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
444 |
<?php if ( $theme['hasUpdate'] ) : ?> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
445 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
446 |
if ( $theme['updateResponse']['compatibleWP'] && $theme['updateResponse']['compatiblePHP'] ) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
447 |
if ( $theme['hasPackage'] ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
448 |
$new_version_available = __( 'New version available. <button class="button-link" type="button">Update now</button>' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
449 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
450 |
$new_version_available = __( 'New version available.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
451 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
452 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
453 |
$new_version_available, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
454 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
455 |
'type' => 'warning', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
456 |
'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
457 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
458 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
459 |
else : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
460 |
$theme_update_error = ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
461 |
if ( ! $theme['updateResponse']['compatibleWP'] && ! $theme['updateResponse']['compatiblePHP'] ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
462 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
463 |
/* translators: %s: Theme name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
464 |
__( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
465 |
$theme['name'] |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
466 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
467 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
468 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
469 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
470 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
471 |
self_admin_url( 'update-core.php' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
472 |
esc_url( wp_get_update_php_url() ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
473 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
474 |
wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
475 |
} elseif ( current_user_can( 'update_core' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
476 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
477 |
/* translators: %s: URL to WordPress Updates screen. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
478 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
479 |
self_admin_url( 'update-core.php' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
480 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
481 |
} elseif ( current_user_can( 'update_php' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
482 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
483 |
/* translators: %s: URL to Update PHP page. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
484 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
485 |
esc_url( wp_get_update_php_url() ) |
16 | 486 |
); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
487 |
wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
488 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
489 |
} elseif ( ! $theme['updateResponse']['compatibleWP'] ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
490 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
491 |
/* translators: %s: Theme name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
492 |
__( 'There is a new version of %s available, but it does not work with your version of WordPress.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
493 |
$theme['name'] |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
494 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
495 |
if ( current_user_can( 'update_core' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
496 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
497 |
/* translators: %s: URL to WordPress Updates screen. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
498 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
499 |
self_admin_url( 'update-core.php' ) |
16 | 500 |
); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
501 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
502 |
} elseif ( ! $theme['updateResponse']['compatiblePHP'] ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
503 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
504 |
/* translators: %s: Theme name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
505 |
__( 'There is a new version of %s available, but it does not work with your version of PHP.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
506 |
$theme['name'] |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
507 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
508 |
if ( current_user_can( 'update_php' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
509 |
$theme_update_error .= sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
510 |
/* translators: %s: URL to Update PHP page. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
511 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
512 |
esc_url( wp_get_update_php_url() ) |
16 | 513 |
); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
514 |
wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
16 | 515 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
516 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
517 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
518 |
$theme_update_error, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
519 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
520 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
521 |
'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
522 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
523 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
524 |
endif; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
525 |
endif; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
526 |
|
16 | 527 |
if ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
528 |
$message = ''; |
16 | 529 |
if ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
530 |
$message = __( 'This theme does not work with your versions of WordPress and PHP.' ); |
16 | 531 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
532 |
$message .= sprintf( |
16 | 533 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
534 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
535 |
self_admin_url( 'update-core.php' ), |
|
536 |
esc_url( wp_get_update_php_url() ) |
|
537 |
); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
538 |
$message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
16 | 539 |
} elseif ( current_user_can( 'update_core' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
540 |
$message .= sprintf( |
16 | 541 |
/* translators: %s: URL to WordPress Updates screen. */ |
542 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
543 |
self_admin_url( 'update-core.php' ) |
|
544 |
); |
|
545 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
546 |
$message .= sprintf( |
16 | 547 |
/* translators: %s: URL to Update PHP page. */ |
548 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
549 |
esc_url( wp_get_update_php_url() ) |
|
550 |
); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
551 |
$message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
16 | 552 |
} |
553 |
} elseif ( ! $theme['compatibleWP'] ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
554 |
$message .= __( 'This theme does not work with your version of WordPress.' ); |
16 | 555 |
if ( current_user_can( 'update_core' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
556 |
$message .= sprintf( |
16 | 557 |
/* translators: %s: URL to WordPress Updates screen. */ |
558 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
559 |
self_admin_url( 'update-core.php' ) |
|
560 |
); |
|
561 |
} |
|
562 |
} elseif ( ! $theme['compatiblePHP'] ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
563 |
$message .= __( 'This theme does not work with your version of PHP.' ); |
16 | 564 |
if ( current_user_can( 'update_php' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
565 |
$message .= sprintf( |
16 | 566 |
/* translators: %s: URL to Update PHP page. */ |
567 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
568 |
esc_url( wp_get_update_php_url() ) |
|
569 |
); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
570 |
$message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); |
16 | 571 |
} |
572 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
573 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
574 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
575 |
$message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
576 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
577 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
578 |
'additional_classes' => array( 'inline', 'notice-alt' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
579 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
580 |
); |
16 | 581 |
} |
582 |
||
18 | 583 |
/* translators: %s: Theme name. */ |
584 |
$details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] ); |
|
585 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
586 |
<button type="button" class="more-details" id="<?php echo esc_attr( $aria_action ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
587 |
aria-label="<?php echo esc_attr( $details_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
588 |
><?php _e( 'Theme Details' ); ?></button> |
16 | 589 |
<div class="theme-author"> |
590 |
<?php |
|
591 |
/* translators: %s: Theme author name. */ |
|
592 |
printf( __( 'By %s' ), $theme['author'] ); |
|
593 |
?> |
|
594 |
</div> |
|
0 | 595 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
596 |
<div class="theme-id-container"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
597 |
<?php if ( $theme['active'] ) { ?> |
19 | 598 |
<h2 class="theme-name" id="<?php echo esc_attr( $aria_name ); ?>"> |
16 | 599 |
<span><?php _ex( 'Active:', 'theme' ); ?></span> <?php echo $theme['name']; ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
600 |
</h2> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
601 |
<?php } else { ?> |
19 | 602 |
<h2 class="theme-name" id="<?php echo esc_attr( $aria_name ); ?>"><?php echo $theme['name']; ?></h2> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
603 |
<?php } ?> |
0 | 604 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
605 |
<div class="theme-actions"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
606 |
<?php if ( $theme['active'] ) { ?> |
18 | 607 |
<?php |
608 |
if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { |
|
609 |
/* translators: %s: Theme name. */ |
|
610 |
$customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] ); |
|
611 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
612 |
<a class="button button-primary customize load-customize hide-if-no-customize" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
613 |
href="<?php echo esc_url( $theme['actions']['customize'] ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
614 |
aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
615 |
><?php _e( 'Customize' ); ?></a> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
616 |
<?php } ?> |
16 | 617 |
<?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
618 |
<?php |
16 | 619 |
/* translators: %s: Theme name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
620 |
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
621 |
?> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
622 |
<a class="button activate" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
623 |
href="<?php echo esc_url( $theme['actions']['activate'] ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
624 |
aria-label="<?php echo esc_attr( $aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
625 |
><?php _e( 'Activate' ); ?></a> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
626 |
|
18 | 627 |
<?php |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
628 |
// Only classic themes require the "customize" capability. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
629 |
if ( current_user_can( 'edit_theme_options' ) && ( $theme['blockTheme'] || current_user_can( 'customize' ) ) ) { |
18 | 630 |
/* translators: %s: Theme name. */ |
631 |
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); |
|
632 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
633 |
<a class="button button-primary load-customize hide-if-no-customize" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
634 |
href="<?php echo esc_url( $theme['actions']['customize'] ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
635 |
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
636 |
><?php _e( 'Live Preview' ); ?></a> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
637 |
<?php } ?> |
16 | 638 |
<?php } else { ?> |
639 |
<?php |
|
640 |
/* translators: %s: Theme name. */ |
|
641 |
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); |
|
642 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
643 |
<a class="button disabled" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
644 |
aria-label="<?php echo esc_attr( $aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
645 |
><?php _ex( 'Cannot Activate', 'theme' ); ?></a> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
646 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
647 |
<?php |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
648 |
if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
649 |
/* translators: %s: Theme name. */ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
650 |
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
651 |
?> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
652 |
<a class="button button-primary hide-if-no-customize disabled" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
653 |
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
654 |
><?php _e( 'Live Preview' ); ?></a> |
16 | 655 |
<?php } ?> |
5 | 656 |
<?php } ?> |
657 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
658 |
</div> |
0 | 659 |
</div> |
660 |
</div> |
|
5 | 661 |
<?php endforeach; ?> |
662 |
</div> |
|
663 |
</div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
664 |
<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div> |
0 | 665 |
|
5 | 666 |
<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> |
0 | 667 |
|
668 |
<?php |
|
669 |
// List broken themes, if any. |
|
16 | 670 |
$broken_themes = wp_get_themes( array( 'errors' => true ) ); |
671 |
if ( ! is_multisite() && $broken_themes ) { |
|
9 | 672 |
?> |
0 | 673 |
|
5 | 674 |
<div class="broken-themes"> |
9 | 675 |
<h3><?php _e( 'Broken Themes' ); ?></h3> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
676 |
<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p> |
0 | 677 |
|
9 | 678 |
<?php |
679 |
$can_resume = current_user_can( 'resume_themes' ); |
|
680 |
$can_delete = current_user_can( 'delete_themes' ); |
|
681 |
$can_install = current_user_can( 'install_themes' ); |
|
682 |
?> |
|
5 | 683 |
<table> |
0 | 684 |
<tr> |
9 | 685 |
<th><?php _ex( 'Name', 'theme name' ); ?></th> |
686 |
<th><?php _e( 'Description' ); ?></th> |
|
687 |
<?php if ( $can_resume ) { ?> |
|
688 |
<td></td> |
|
689 |
<?php } ?> |
|
5 | 690 |
<?php if ( $can_delete ) { ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
691 |
<td></td> |
5 | 692 |
<?php } ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
693 |
<?php if ( $can_install ) { ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
694 |
<td></td> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
695 |
<?php } ?> |
0 | 696 |
</tr> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
697 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
698 |
foreach ( $broken_themes as $broken_theme ) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
699 |
?> |
0 | 700 |
<tr> |
16 | 701 |
<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ); ?></td> |
5 | 702 |
<td><?php echo $broken_theme->errors()->get_error_message(); ?></td> |
703 |
<?php |
|
9 | 704 |
if ( $can_resume ) { |
705 |
if ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) { |
|
706 |
$stylesheet = $broken_theme->get_stylesheet(); |
|
707 |
$resume_url = add_query_arg( |
|
708 |
array( |
|
709 |
'action' => 'resume', |
|
710 |
'stylesheet' => urlencode( $stylesheet ), |
|
711 |
), |
|
712 |
admin_url( 'themes.php' ) |
|
713 |
); |
|
714 |
$resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet ); |
|
715 |
?> |
|
716 |
<td><a href="<?php echo esc_url( $resume_url ); ?>" class="button resume-theme"><?php _e( 'Resume' ); ?></a></td> |
|
717 |
<?php |
|
718 |
} else { |
|
719 |
?> |
|
720 |
<td></td> |
|
721 |
<?php |
|
722 |
} |
|
723 |
} |
|
724 |
||
5 | 725 |
if ( $can_delete ) { |
726 |
$stylesheet = $broken_theme->get_stylesheet(); |
|
9 | 727 |
$delete_url = add_query_arg( |
728 |
array( |
|
729 |
'action' => 'delete', |
|
730 |
'stylesheet' => urlencode( $stylesheet ), |
|
731 |
), |
|
732 |
admin_url( 'themes.php' ) |
|
733 |
); |
|
5 | 734 |
$delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet ); |
735 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
736 |
<td><a href="<?php echo esc_url( $delete_url ); ?>" class="button delete-theme"><?php _e( 'Delete' ); ?></a></td> |
5 | 737 |
<?php |
738 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
739 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
740 |
if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
741 |
$parent_theme_name = $broken_theme->get( 'Template' ); |
9 | 742 |
$parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
743 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
744 |
if ( ! is_wp_error( $parent_theme ) ) { |
9 | 745 |
$install_url = add_query_arg( |
746 |
array( |
|
747 |
'action' => 'install-theme', |
|
748 |
'theme' => urlencode( $parent_theme_name ), |
|
749 |
), |
|
750 |
admin_url( 'update.php' ) |
|
751 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
752 |
$install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
753 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
754 |
<td><a href="<?php echo esc_url( $install_url ); ?>" class="button install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
755 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
756 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
757 |
} |
5 | 758 |
?> |
759 |
</tr> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
760 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
761 |
endforeach; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
762 |
?> |
0 | 763 |
</table> |
5 | 764 |
</div> |
765 |
||
9 | 766 |
<?php |
0 | 767 |
} |
768 |
?> |
|
5 | 769 |
</div><!-- .wrap --> |
770 |
||
771 |
<?php |
|
16 | 772 |
|
773 |
/** |
|
774 |
* Returns the JavaScript template used to display the auto-update setting for a theme. |
|
775 |
* |
|
776 |
* @since 5.5.0 |
|
777 |
* |
|
778 |
* @return string The template for displaying the auto-update setting link. |
|
779 |
*/ |
|
780 |
function wp_theme_auto_update_setting_template() { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
781 |
$notice = wp_get_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
782 |
'', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
783 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
784 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
785 |
'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
786 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
787 |
); |
16 | 788 |
$template = ' |
789 |
<div class="theme-autoupdate"> |
|
790 |
<# if ( data.autoupdate.supported ) { #> |
|
791 |
<# if ( data.autoupdate.forced === false ) { #> |
|
792 |
' . __( 'Auto-updates disabled' ) . ' |
|
793 |
<# } else if ( data.autoupdate.forced ) { #> |
|
794 |
' . __( 'Auto-updates enabled' ) . ' |
|
795 |
<# } else if ( data.autoupdate.enabled ) { #> |
|
796 |
<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="disable"> |
|
797 |
<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Disable auto-updates' ) . '</span> |
|
798 |
</button> |
|
799 |
<# } else { #> |
|
800 |
<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="enable"> |
|
801 |
<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Enable auto-updates' ) . '</span> |
|
802 |
</button> |
|
803 |
<# } #> |
|
804 |
<# } #> |
|
805 |
<# if ( data.hasUpdate ) { #> |
|
806 |
<# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #> |
|
807 |
<span class="auto-update-time"> |
|
808 |
<# } else { #> |
|
809 |
<span class="auto-update-time hidden"> |
|
810 |
<# } #> |
|
811 |
<br />' . wp_get_auto_update_message() . '</span> |
|
812 |
<# } #> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
813 |
' . $notice . ' |
16 | 814 |
</div> |
815 |
'; |
|
816 |
||
817 |
/** |
|
818 |
* Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay). |
|
819 |
* |
|
820 |
* See {@see wp_prepare_themes_for_js()} for the properties of the `data` object. |
|
821 |
* |
|
822 |
* @since 5.5.0 |
|
823 |
* |
|
824 |
* @param string $template The template for displaying the auto-update setting link. |
|
825 |
*/ |
|
826 |
return apply_filters( 'theme_auto_update_setting_template', $template ); |
|
827 |
} |
|
828 |
||
5 | 829 |
/* |
830 |
* The tmpl-theme template is synchronized with PHP above! |
|
831 |
*/ |
|
832 |
?> |
|
833 |
<script id="tmpl-theme" type="text/template"> |
|
834 |
<# if ( data.screenshot[0] ) { #> |
|
835 |
<div class="theme-screenshot"> |
|
19 | 836 |
<img src="{{ data.screenshot[0] }}?ver={{ data.version }}" alt="" /> |
5 | 837 |
</div> |
838 |
<# } else { #> |
|
839 |
<div class="theme-screenshot blank"></div> |
|
840 |
<# } #> |
|
841 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
842 |
<# if ( data.hasUpdate ) { #> |
16 | 843 |
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #> |
844 |
<div class="update-message notice inline notice-warning notice-alt"><p> |
|
845 |
<# if ( data.hasPackage ) { #> |
|
846 |
<?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?> |
|
847 |
<# } else { #> |
|
848 |
<?php _e( 'New version available.' ); ?> |
|
849 |
<# } #> |
|
850 |
</p></div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
851 |
<# } else { #> |
16 | 852 |
<div class="update-message notice inline notice-error notice-alt"><p> |
853 |
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> |
|
854 |
<?php |
|
855 |
printf( |
|
856 |
/* translators: %s: Theme name. */ |
|
19 | 857 |
__( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ), |
16 | 858 |
'{{{ data.name }}}' |
859 |
); |
|
860 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
|
861 |
printf( |
|
862 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
863 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
864 |
self_admin_url( 'update-core.php' ), |
|
865 |
esc_url( wp_get_update_php_url() ) |
|
866 |
); |
|
867 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
868 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
869 |
printf( |
|
870 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
871 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
872 |
self_admin_url( 'update-core.php' ) |
|
873 |
); |
|
874 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
875 |
printf( |
|
876 |
/* translators: %s: URL to Update PHP page. */ |
|
877 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
878 |
esc_url( wp_get_update_php_url() ) |
|
879 |
); |
|
880 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
881 |
} |
|
882 |
?> |
|
883 |
<# } else if ( ! data.updateResponse.compatibleWP ) { #> |
|
884 |
<?php |
|
885 |
printf( |
|
886 |
/* translators: %s: Theme name. */ |
|
19 | 887 |
__( 'There is a new version of %s available, but it does not work with your version of WordPress.' ), |
16 | 888 |
'{{{ data.name }}}' |
889 |
); |
|
890 |
if ( current_user_can( 'update_core' ) ) { |
|
891 |
printf( |
|
892 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
893 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
894 |
self_admin_url( 'update-core.php' ) |
|
895 |
); |
|
896 |
} |
|
897 |
?> |
|
898 |
<# } else if ( ! data.updateResponse.compatiblePHP ) { #> |
|
899 |
<?php |
|
900 |
printf( |
|
901 |
/* translators: %s: Theme name. */ |
|
19 | 902 |
__( 'There is a new version of %s available, but it does not work with your version of PHP.' ), |
16 | 903 |
'{{{ data.name }}}' |
904 |
); |
|
905 |
if ( current_user_can( 'update_php' ) ) { |
|
906 |
printf( |
|
907 |
/* translators: %s: URL to Update PHP page. */ |
|
908 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
909 |
esc_url( wp_get_update_php_url() ) |
|
910 |
); |
|
911 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
912 |
} |
|
913 |
?> |
|
914 |
<# } #> |
|
915 |
</p></div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
916 |
<# } #> |
5 | 917 |
<# } #> |
918 |
||
16 | 919 |
<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #> |
920 |
<div class="notice notice-error notice-alt"><p> |
|
921 |
<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #> |
|
922 |
<?php |
|
19 | 923 |
_e( 'This theme does not work with your versions of WordPress and PHP.' ); |
16 | 924 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
925 |
printf( |
|
926 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
927 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
928 |
self_admin_url( 'update-core.php' ), |
|
929 |
esc_url( wp_get_update_php_url() ) |
|
930 |
); |
|
931 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
932 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
933 |
printf( |
|
934 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
935 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
936 |
self_admin_url( 'update-core.php' ) |
|
937 |
); |
|
938 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
939 |
printf( |
|
940 |
/* translators: %s: URL to Update PHP page. */ |
|
941 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
942 |
esc_url( wp_get_update_php_url() ) |
|
943 |
); |
|
944 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
945 |
} |
|
946 |
?> |
|
947 |
<# } else if ( ! data.compatibleWP ) { #> |
|
948 |
<?php |
|
19 | 949 |
_e( 'This theme does not work with your version of WordPress.' ); |
16 | 950 |
if ( current_user_can( 'update_core' ) ) { |
951 |
printf( |
|
952 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
953 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
954 |
self_admin_url( 'update-core.php' ) |
|
955 |
); |
|
956 |
} |
|
957 |
?> |
|
958 |
<# } else if ( ! data.compatiblePHP ) { #> |
|
959 |
<?php |
|
19 | 960 |
_e( 'This theme does not work with your version of PHP.' ); |
16 | 961 |
if ( current_user_can( 'update_php' ) ) { |
962 |
printf( |
|
963 |
/* translators: %s: URL to Update PHP page. */ |
|
964 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
965 |
esc_url( wp_get_update_php_url() ) |
|
966 |
); |
|
967 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
968 |
} |
|
969 |
?> |
|
970 |
<# } #> |
|
971 |
</p></div> |
|
972 |
<# } #> |
|
973 |
||
18 | 974 |
<?php |
975 |
/* translators: %s: Theme name. */ |
|
976 |
$details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), '{{ data.name }}' ); |
|
977 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
978 |
<button type="button" class="more-details" id="{{ data.id }}-action" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
979 |
aria-label="<?php echo esc_attr( $details_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
980 |
><?php _e( 'Theme Details' ); ?></button> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
981 |
<div class="theme-author"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
982 |
<?php |
16 | 983 |
/* translators: %s: Theme author name. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
984 |
printf( __( 'By %s' ), '{{{ data.author }}}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
985 |
?> |
5 | 986 |
</div> |
987 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
988 |
<div class="theme-id-container"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
989 |
<# if ( data.active ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
990 |
<h2 class="theme-name" id="{{ data.id }}-name"> |
16 | 991 |
<span><?php _ex( 'Active:', 'theme' ); ?></span> {{{ data.name }}} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
992 |
</h2> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
993 |
<# } else { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
994 |
<h2 class="theme-name" id="{{ data.id }}-name">{{{ data.name }}}</h2> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
995 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
996 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
997 |
<div class="theme-actions"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
998 |
<# if ( data.active ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
999 |
<# if ( data.actions.customize ) { #> |
18 | 1000 |
<?php |
1001 |
/* translators: %s: Theme name. */ |
|
1002 |
$customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' ); |
|
1003 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1004 |
<a class="button button-primary customize load-customize hide-if-no-customize" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1005 |
href="{{{ data.actions.customize }}}" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1006 |
aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1007 |
><?php _e( 'Customize' ); ?></a> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1008 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1009 |
<# } else { #> |
16 | 1010 |
<# if ( data.compatibleWP && data.compatiblePHP ) { #> |
1011 |
<?php |
|
1012 |
/* translators: %s: Theme name. */ |
|
1013 |
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
|
1014 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1015 |
<a class="button activate" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1016 |
href="{{{ data.actions.activate }}}" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1017 |
aria-label="<?php echo esc_attr( $aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1018 |
><?php _e( 'Activate' ); ?></a> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1019 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1020 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1021 |
/* translators: %s: Theme name. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1022 |
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1023 |
?> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1024 |
<a class="button button-primary load-customize hide-if-no-customize" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1025 |
href="{{{ data.actions.customize }}}" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1026 |
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1027 |
><?php _e( 'Live Preview' ); ?></a> |
16 | 1028 |
<# } else { #> |
1029 |
<?php |
|
1030 |
/* translators: %s: Theme name. */ |
|
1031 |
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); |
|
1032 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1033 |
<a class="button disabled" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1034 |
aria-label="<?php echo esc_attr( $aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1035 |
><?php _ex( 'Cannot Activate', 'theme' ); ?></a> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1036 |
|
19 | 1037 |
<# if ( ! data.blockTheme ) { #> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1038 |
<?php |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1039 |
/* translators: %s: Theme name. */ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1040 |
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1041 |
?> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1042 |
<a class="button button-primary hide-if-no-customize disabled" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1043 |
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1044 |
><?php _e( 'Live Preview' ); ?></a> |
19 | 1045 |
<# } #> |
16 | 1046 |
<# } #> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1047 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1048 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1049 |
</div> |
5 | 1050 |
</script> |
0 | 1051 |
|
5 | 1052 |
<script id="tmpl-theme-single" type="text/template"> |
1053 |
<div class="theme-backdrop"></div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1054 |
<div class="theme-wrap wp-clearfix" role="document"> |
5 | 1055 |
<div class="theme-header"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1056 |
<button class="left dashicons dashicons-no"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1057 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1058 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1059 |
_e( 'Show previous theme' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1060 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1061 |
</span></button> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1062 |
<button class="right dashicons dashicons-no"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1063 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1064 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1065 |
_e( 'Show next theme' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1066 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1067 |
</span></button> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1068 |
<button class="close dashicons dashicons-no"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1069 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1070 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1071 |
_e( 'Close details dialog' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1072 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1073 |
</span></button> |
5 | 1074 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1075 |
<div class="theme-about wp-clearfix"> |
5 | 1076 |
<div class="theme-screenshots"> |
1077 |
<# if ( data.screenshot[0] ) { #> |
|
19 | 1078 |
<div class="screenshot"><img src="{{ data.screenshot[0] }}?ver={{ data.version }}" alt="" /></div> |
5 | 1079 |
<# } else { #> |
1080 |
<div class="screenshot blank"></div> |
|
1081 |
<# } #> |
|
1082 |
</div> |
|
1083 |
||
1084 |
<div class="theme-info"> |
|
1085 |
<# if ( data.active ) { #> |
|
19 | 1086 |
<span class="current-label"><?php _e( 'Active Theme' ); ?></span> |
5 | 1087 |
<# } #> |
16 | 1088 |
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version"> |
1089 |
<?php |
|
1090 |
/* translators: %s: Theme version. */ |
|
1091 |
printf( __( 'Version: %s' ), '{{ data.version }}' ); |
|
1092 |
?> |
|
1093 |
</span></h2> |
|
1094 |
<p class="theme-author"> |
|
1095 |
<?php |
|
1096 |
/* translators: %s: Theme author link. */ |
|
1097 |
printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); |
|
1098 |
?> |
|
1099 |
</p> |
|
1100 |
||
1101 |
<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #> |
|
1102 |
<div class="notice notice-error notice-alt notice-large"><p> |
|
1103 |
<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #> |
|
1104 |
<?php |
|
19 | 1105 |
_e( 'This theme does not work with your versions of WordPress and PHP.' ); |
16 | 1106 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
1107 |
printf( |
|
1108 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
1109 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
1110 |
self_admin_url( 'update-core.php' ), |
|
1111 |
esc_url( wp_get_update_php_url() ) |
|
1112 |
); |
|
1113 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
1114 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
1115 |
printf( |
|
1116 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
1117 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
1118 |
self_admin_url( 'update-core.php' ) |
|
1119 |
); |
|
1120 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
1121 |
printf( |
|
1122 |
/* translators: %s: URL to Update PHP page. */ |
|
1123 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
1124 |
esc_url( wp_get_update_php_url() ) |
|
1125 |
); |
|
1126 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
1127 |
} |
|
1128 |
?> |
|
1129 |
<# } else if ( ! data.compatibleWP ) { #> |
|
1130 |
<?php |
|
19 | 1131 |
_e( 'This theme does not work with your version of WordPress.' ); |
16 | 1132 |
if ( current_user_can( 'update_core' ) ) { |
1133 |
printf( |
|
1134 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
1135 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
1136 |
self_admin_url( 'update-core.php' ) |
|
1137 |
); |
|
1138 |
} |
|
1139 |
?> |
|
1140 |
<# } else if ( ! data.compatiblePHP ) { #> |
|
1141 |
<?php |
|
19 | 1142 |
_e( 'This theme does not work with your version of PHP.' ); |
16 | 1143 |
if ( current_user_can( 'update_php' ) ) { |
1144 |
printf( |
|
1145 |
/* translators: %s: URL to Update PHP page. */ |
|
1146 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
1147 |
esc_url( wp_get_update_php_url() ) |
|
1148 |
); |
|
1149 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
1150 |
} |
|
1151 |
?> |
|
1152 |
<# } #> |
|
1153 |
</p></div> |
|
1154 |
<# } #> |
|
5 | 1155 |
|
1156 |
<# if ( data.hasUpdate ) { #> |
|
16 | 1157 |
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #> |
1158 |
<div class="notice notice-warning notice-alt notice-large"> |
|
1159 |
<h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3> |
|
1160 |
{{{ data.update }}} |
|
1161 |
</div> |
|
1162 |
<# } else { #> |
|
1163 |
<div class="notice notice-error notice-alt notice-large"> |
|
1164 |
<h3 class="notice-title"><?php _e( 'Update Incompatible' ); ?></h3> |
|
1165 |
<p> |
|
1166 |
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> |
|
1167 |
<?php |
|
1168 |
printf( |
|
1169 |
/* translators: %s: Theme name. */ |
|
19 | 1170 |
__( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ), |
16 | 1171 |
'{{{ data.name }}}' |
1172 |
); |
|
1173 |
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { |
|
1174 |
printf( |
|
1175 |
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ |
|
1176 |
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), |
|
1177 |
self_admin_url( 'update-core.php' ), |
|
1178 |
esc_url( wp_get_update_php_url() ) |
|
1179 |
); |
|
1180 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
1181 |
} elseif ( current_user_can( 'update_core' ) ) { |
|
1182 |
printf( |
|
1183 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
1184 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
1185 |
self_admin_url( 'update-core.php' ) |
|
1186 |
); |
|
1187 |
} elseif ( current_user_can( 'update_php' ) ) { |
|
1188 |
printf( |
|
1189 |
/* translators: %s: URL to Update PHP page. */ |
|
1190 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
1191 |
esc_url( wp_get_update_php_url() ) |
|
1192 |
); |
|
1193 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
1194 |
} |
|
1195 |
?> |
|
1196 |
<# } else if ( ! data.updateResponse.compatibleWP ) { #> |
|
1197 |
<?php |
|
1198 |
printf( |
|
1199 |
/* translators: %s: Theme name. */ |
|
19 | 1200 |
__( 'There is a new version of %s available, but it does not work with your version of WordPress.' ), |
16 | 1201 |
'{{{ data.name }}}' |
1202 |
); |
|
1203 |
if ( current_user_can( 'update_core' ) ) { |
|
1204 |
printf( |
|
1205 |
/* translators: %s: URL to WordPress Updates screen. */ |
|
1206 |
' ' . __( '<a href="%s">Please update WordPress</a>.' ), |
|
1207 |
self_admin_url( 'update-core.php' ) |
|
1208 |
); |
|
1209 |
} |
|
1210 |
?> |
|
1211 |
<# } else if ( ! data.updateResponse.compatiblePHP ) { #> |
|
1212 |
<?php |
|
1213 |
printf( |
|
1214 |
/* translators: %s: Theme name. */ |
|
19 | 1215 |
__( 'There is a new version of %s available, but it does not work with your version of PHP.' ), |
16 | 1216 |
'{{{ data.name }}}' |
1217 |
); |
|
1218 |
if ( current_user_can( 'update_php' ) ) { |
|
1219 |
printf( |
|
1220 |
/* translators: %s: URL to Update PHP page. */ |
|
1221 |
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), |
|
1222 |
esc_url( wp_get_update_php_url() ) |
|
1223 |
); |
|
1224 |
wp_update_php_annotation( '</p><p><em>', '</em>' ); |
|
1225 |
} |
|
1226 |
?> |
|
1227 |
<# } #> |
|
1228 |
</p> |
|
1229 |
</div> |
|
1230 |
<# } #> |
|
5 | 1231 |
<# } #> |
16 | 1232 |
|
1233 |
<# if ( data.actions.autoupdate ) { #> |
|
1234 |
<?php echo wp_theme_auto_update_setting_template(); ?> |
|
1235 |
<# } #> |
|
1236 |
||
5 | 1237 |
<p class="theme-description">{{{ data.description }}}</p> |
1238 |
||
1239 |
<# if ( data.parent ) { #> |
|
16 | 1240 |
<p class="parent-theme"> |
1241 |
<?php |
|
1242 |
/* translators: %s: Theme name. */ |
|
1243 |
printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); |
|
1244 |
?> |
|
1245 |
</p> |
|
5 | 1246 |
<# } #> |
1247 |
||
1248 |
<# if ( data.tags ) { #> |
|
1249 |
<p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p> |
|
1250 |
<# } #> |
|
1251 |
</div> |
|
1252 |
</div> |
|
1253 |
||
1254 |
<div class="theme-actions"> |
|
1255 |
<div class="active-theme"> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1256 |
<a class="button button-primary customize load-customize hide-if-no-customize" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1257 |
href="{{{ data.actions.customize }}}" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1258 |
><?php _e( 'Customize' ); ?></a> |
5 | 1259 |
<?php echo implode( ' ', $current_theme_actions ); ?> |
1260 |
</div> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1261 |
|
5 | 1262 |
<div class="inactive-theme"> |
16 | 1263 |
<# if ( data.compatibleWP && data.compatiblePHP ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1264 |
<# if ( ! data.blockTheme ) { #> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1265 |
<?php |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1266 |
/* translators: %s: Theme name. */ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1267 |
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1268 |
?> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1269 |
<a class="button button-primary load-customize hide-if-no-customize" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1270 |
href="{{{ data.actions.customize }}}" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1271 |
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1272 |
><?php _e( 'Live Preview' ); ?></a> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1273 |
<# } #> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1274 |
|
16 | 1275 |
<# if ( data.actions.activate ) { #> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1276 |
<?php |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1277 |
/* translators: %s: Theme name. */ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1278 |
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1279 |
?> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1280 |
<a class="button activate" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1281 |
href="{{{ data.actions.activate }}}" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1282 |
aria-label="<?php echo esc_attr( $aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1283 |
><?php _e( 'Activate' ); ?></a> |
16 | 1284 |
<# } #> |
1285 |
<# } else { #> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1286 |
<# if ( ! data.blockTheme ) { #> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1287 |
<?php |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1288 |
/* translators: %s: Theme name. */ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1289 |
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1290 |
?> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1291 |
<a class="button button-primary hide-if-no-customize disabled" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1292 |
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1293 |
><?php _e( 'Live Preview' ); ?></a> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1294 |
<# } #> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1295 |
|
16 | 1296 |
<# if ( data.actions.activate ) { #> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1297 |
<?php |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1298 |
/* translators: %s: Theme name. */ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1299 |
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1300 |
?> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1301 |
<a class="button disabled" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1302 |
aria-label="<?php echo esc_attr( $aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1303 |
><?php _ex( 'Cannot Activate', 'theme' ); ?></a> |
16 | 1304 |
<# } #> |
5 | 1305 |
<# } #> |
1306 |
</div> |
|
1307 |
||
1308 |
<# if ( ! data.active && data.actions['delete'] ) { #> |
|
18 | 1309 |
<?php |
1310 |
/* translators: %s: Theme name. */ |
|
1311 |
$aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' ); |
|
1312 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1313 |
<a class="button delete-theme" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1314 |
href="{{{ data.actions['delete'] }}}" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1315 |
aria-label="<?php echo esc_attr( $aria_label ); ?>" |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1316 |
><?php _e( 'Delete' ); ?></a> |
5 | 1317 |
<# } #> |
1318 |
</div> |
|
1319 |
</div> |
|
1320 |
</script> |
|
1321 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1322 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1323 |
wp_print_request_filesystem_credentials_modal(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1324 |
wp_print_admin_notice_templates(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1325 |
wp_print_update_row_templates(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1326 |
|
9 | 1327 |
wp_localize_script( |
1328 |
'updates', |
|
1329 |
'_wpUpdatesItemCounts', |
|
1330 |
array( |
|
1331 |
'totals' => wp_get_update_data(), |
|
1332 |
) |
|
1333 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1334 |
|
16 | 1335 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |