author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Update/Install Plugin/Theme administration panel. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
16 | 9 |
if ( ! defined( 'IFRAME_REQUEST' ) |
10 |
&& isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ), true ) |
|
11 |
) { |
|
0 | 12 |
define( 'IFRAME_REQUEST', true ); |
9 | 13 |
} |
0 | 14 |
|
15 |
/** WordPress Administration Bootstrap */ |
|
16 | 16 |
require_once __DIR__ . '/admin.php'; |
0 | 17 |
|
16 | 18 |
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
19 |
||
20 |
wp_enqueue_script( 'wp-a11y' ); |
|
0 | 21 |
|
9 | 22 |
if ( isset( $_GET['action'] ) ) { |
23 |
$plugin = isset( $_REQUEST['plugin'] ) ? trim( $_REQUEST['plugin'] ) : ''; |
|
24 |
$theme = isset( $_REQUEST['theme'] ) ? urldecode( $_REQUEST['theme'] ) : ''; |
|
25 |
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; |
|
0 | 26 |
|
16 | 27 |
if ( 'update-selected' === $action ) { |
9 | 28 |
if ( ! current_user_can( 'update_plugins' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) ); |
9 | 30 |
} |
0 | 31 |
|
32 |
check_admin_referer( 'bulk-update-plugins' ); |
|
33 |
||
9 | 34 |
if ( isset( $_GET['plugins'] ) ) { |
35 |
$plugins = explode( ',', stripslashes( $_GET['plugins'] ) ); |
|
36 |
} elseif ( isset( $_POST['checked'] ) ) { |
|
0 | 37 |
$plugins = (array) $_POST['checked']; |
9 | 38 |
} else { |
0 | 39 |
$plugins = array(); |
9 | 40 |
} |
0 | 41 |
|
9 | 42 |
$plugins = array_map( 'urldecode', $plugins ); |
0 | 43 |
|
9 | 44 |
$url = 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) ); |
0 | 45 |
$nonce = 'bulk-update-plugins'; |
46 |
||
5 | 47 |
wp_enqueue_script( 'updates' ); |
0 | 48 |
iframe_header(); |
49 |
||
50 |
$upgrader = new Plugin_Upgrader( new Bulk_Plugin_Upgrader_Skin( compact( 'nonce', 'url' ) ) ); |
|
51 |
$upgrader->bulk_upgrade( $plugins ); |
|
52 |
||
53 |
iframe_footer(); |
|
54 |
||
16 | 55 |
} elseif ( 'upgrade-plugin' === $action ) { |
9 | 56 |
if ( ! current_user_can( 'update_plugins' ) ) { |
57 |
wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) ); |
|
58 |
} |
|
0 | 59 |
|
9 | 60 |
check_admin_referer( 'upgrade-plugin_' . $plugin ); |
0 | 61 |
|
19 | 62 |
// Used in the HTML title tag. |
9 | 63 |
$title = __( 'Update Plugin' ); |
64 |
$parent_file = 'plugins.php'; |
|
0 | 65 |
$submenu_file = 'plugins.php'; |
5 | 66 |
|
67 |
wp_enqueue_script( 'updates' ); |
|
16 | 68 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 69 |
|
70 |
$nonce = 'upgrade-plugin_' . $plugin; |
|
9 | 71 |
$url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin ); |
0 | 72 |
|
9 | 73 |
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) ) ); |
74 |
$upgrader->upgrade( $plugin ); |
|
0 | 75 |
|
16 | 76 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
0 | 77 |
|
16 | 78 |
} elseif ( 'activate-plugin' === $action ) { |
9 | 79 |
if ( ! current_user_can( 'update_plugins' ) ) { |
80 |
wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) ); |
|
81 |
} |
|
0 | 82 |
|
9 | 83 |
check_admin_referer( 'activate-plugin_' . $plugin ); |
84 |
if ( ! isset( $_GET['failure'] ) && ! isset( $_GET['success'] ) ) { |
|
85 |
wp_redirect( admin_url( 'update.php?action=activate-plugin&failure=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) ); |
|
0 | 86 |
activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true ); |
9 | 87 |
wp_redirect( admin_url( 'update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce'] ) ); |
0 | 88 |
die(); |
89 |
} |
|
9 | 90 |
iframe_header( __( 'Plugin Reactivation' ), true ); |
91 |
if ( isset( $_GET['success'] ) ) { |
|
92 |
echo '<p>' . __( 'Plugin reactivated successfully.' ) . '</p>'; |
|
93 |
} |
|
0 | 94 |
|
9 | 95 |
if ( isset( $_GET['failure'] ) ) { |
96 |
echo '<p>' . __( 'Plugin failed to reactivate due to a fatal error.' ) . '</p>'; |
|
0 | 97 |
|
98 |
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); |
|
16 | 99 |
ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed. |
5 | 100 |
wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); |
16 | 101 |
include WP_PLUGIN_DIR . '/' . $plugin; |
0 | 102 |
} |
103 |
iframe_footer(); |
|
16 | 104 |
} elseif ( 'install-plugin' === $action ) { |
0 | 105 |
|
9 | 106 |
if ( ! current_user_can( 'install_plugins' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
107 |
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) ); |
9 | 108 |
} |
0 | 109 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
110 |
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // For plugins_api(). |
0 | 111 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
112 |
check_admin_referer( 'install-plugin_' . $plugin ); |
9 | 113 |
$api = plugins_api( |
114 |
'plugin_information', |
|
115 |
array( |
|
116 |
'slug' => $plugin, |
|
117 |
'fields' => array( |
|
118 |
'sections' => false, |
|
119 |
), |
|
120 |
) |
|
121 |
); |
|
0 | 122 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
123 |
if ( is_wp_error( $api ) ) { |
9 | 124 |
wp_die( $api ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
125 |
} |
0 | 126 |
|
19 | 127 |
// Used in the HTML title tag. |
9 | 128 |
$title = __( 'Plugin Installation' ); |
129 |
$parent_file = 'plugins.php'; |
|
0 | 130 |
$submenu_file = 'plugin-install.php'; |
19 | 131 |
|
16 | 132 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 133 |
|
16 | 134 |
/* translators: %s: Plugin name and version. */ |
9 | 135 |
$title = sprintf( __( 'Installing Plugin: %s' ), $api->name . ' ' . $api->version ); |
0 | 136 |
$nonce = 'install-plugin_' . $plugin; |
9 | 137 |
$url = 'update.php?action=install-plugin&plugin=' . urlencode( $plugin ); |
138 |
if ( isset( $_GET['from'] ) ) { |
|
139 |
$url .= '&from=' . urlencode( stripslashes( $_GET['from'] ) ); |
|
140 |
} |
|
0 | 141 |
|
16 | 142 |
$type = 'web'; // Install plugin type, From Web or an Upload. |
0 | 143 |
|
9 | 144 |
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) ); |
145 |
$upgrader->install( $api->download_link ); |
|
0 | 146 |
|
16 | 147 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
0 | 148 |
|
16 | 149 |
} elseif ( 'upload-plugin' === $action ) { |
0 | 150 |
|
5 | 151 |
if ( ! current_user_can( 'upload_plugins' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
152 |
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) ); |
5 | 153 |
} |
0 | 154 |
|
9 | 155 |
check_admin_referer( 'plugin-upload' ); |
0 | 156 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
157 |
if ( isset( $_FILES['pluginzip']['name'] ) && ! str_ends_with( strtolower( $_FILES['pluginzip']['name'] ), '.zip' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
158 |
wp_die( __( 'Only .zip archives may be uploaded.' ) ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
159 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
160 |
|
9 | 161 |
$file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' ); |
0 | 162 |
|
19 | 163 |
// Used in the HTML title tag. |
9 | 164 |
$title = __( 'Upload Plugin' ); |
165 |
$parent_file = 'plugins.php'; |
|
0 | 166 |
$submenu_file = 'plugin-install.php'; |
19 | 167 |
|
16 | 168 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 169 |
|
16 | 170 |
/* translators: %s: File name. */ |
171 |
$title = sprintf( __( 'Installing plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) ); |
|
0 | 172 |
$nonce = 'plugin-upload'; |
9 | 173 |
$url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-plugin' ); |
16 | 174 |
$type = 'upload'; // Install plugin type, From Web or an Upload. |
9 | 175 |
|
16 | 176 |
$overwrite = isset( $_GET['overwrite'] ) ? sanitize_text_field( $_GET['overwrite'] ) : ''; |
177 |
$overwrite = in_array( $overwrite, array( 'update-plugin', 'downgrade-plugin' ), true ) ? $overwrite : ''; |
|
178 |
||
179 |
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'type', 'title', 'nonce', 'url', 'overwrite' ) ) ); |
|
180 |
$result = $upgrader->install( $file_upload->package, array( 'overwrite_package' => $overwrite ) ); |
|
0 | 181 |
|
9 | 182 |
if ( $result || is_wp_error( $result ) ) { |
183 |
$file_upload->cleanup(); |
|
184 |
} |
|
0 | 185 |
|
16 | 186 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
187 |
||
188 |
} elseif ( 'upload-plugin-cancel-overwrite' === $action ) { |
|
189 |
if ( ! current_user_can( 'upload_plugins' ) ) { |
|
190 |
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) ); |
|
191 |
} |
|
192 |
||
193 |
check_admin_referer( 'plugin-upload-cancel-overwrite' ); |
|
0 | 194 |
|
16 | 195 |
// Make sure the attachment still exists, or File_Upload_Upgrader will call wp_die() |
196 |
// that shows a generic "Please select a file" error. |
|
197 |
if ( ! empty( $_GET['package'] ) ) { |
|
198 |
$attachment_id = (int) $_GET['package']; |
|
199 |
||
200 |
if ( get_post( $attachment_id ) ) { |
|
201 |
$file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' ); |
|
202 |
$file_upload->cleanup(); |
|
203 |
} |
|
204 |
} |
|
205 |
||
206 |
wp_redirect( self_admin_url( 'plugin-install.php' ) ); |
|
207 |
exit; |
|
208 |
} elseif ( 'upgrade-theme' === $action ) { |
|
0 | 209 |
|
9 | 210 |
if ( ! current_user_can( 'update_themes' ) ) { |
211 |
wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) ); |
|
212 |
} |
|
0 | 213 |
|
9 | 214 |
check_admin_referer( 'upgrade-theme_' . $theme ); |
0 | 215 |
|
5 | 216 |
wp_enqueue_script( 'updates' ); |
0 | 217 |
|
19 | 218 |
// Used in the HTML title tag. |
9 | 219 |
$title = __( 'Update Theme' ); |
220 |
$parent_file = 'themes.php'; |
|
0 | 221 |
$submenu_file = 'themes.php'; |
19 | 222 |
|
16 | 223 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 224 |
|
225 |
$nonce = 'upgrade-theme_' . $theme; |
|
9 | 226 |
$url = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme ); |
0 | 227 |
|
9 | 228 |
$upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'theme' ) ) ); |
229 |
$upgrader->upgrade( $theme ); |
|
0 | 230 |
|
16 | 231 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
232 |
} elseif ( 'update-selected-themes' === $action ) { |
|
9 | 233 |
if ( ! current_user_can( 'update_themes' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
234 |
wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) ); |
9 | 235 |
} |
0 | 236 |
|
237 |
check_admin_referer( 'bulk-update-themes' ); |
|
238 |
||
9 | 239 |
if ( isset( $_GET['themes'] ) ) { |
240 |
$themes = explode( ',', stripslashes( $_GET['themes'] ) ); |
|
241 |
} elseif ( isset( $_POST['checked'] ) ) { |
|
0 | 242 |
$themes = (array) $_POST['checked']; |
9 | 243 |
} else { |
0 | 244 |
$themes = array(); |
9 | 245 |
} |
0 | 246 |
|
9 | 247 |
$themes = array_map( 'urldecode', $themes ); |
0 | 248 |
|
9 | 249 |
$url = 'update.php?action=update-selected-themes&themes=' . urlencode( implode( ',', $themes ) ); |
0 | 250 |
$nonce = 'bulk-update-themes'; |
251 |
||
5 | 252 |
wp_enqueue_script( 'updates' ); |
0 | 253 |
iframe_header(); |
254 |
||
255 |
$upgrader = new Theme_Upgrader( new Bulk_Theme_Upgrader_Skin( compact( 'nonce', 'url' ) ) ); |
|
256 |
$upgrader->bulk_upgrade( $themes ); |
|
257 |
||
258 |
iframe_footer(); |
|
16 | 259 |
} elseif ( 'install-theme' === $action ) { |
0 | 260 |
|
9 | 261 |
if ( ! current_user_can( 'install_themes' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
262 |
wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); |
9 | 263 |
} |
0 | 264 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
265 |
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // For themes_api(). |
0 | 266 |
|
5 | 267 |
check_admin_referer( 'install-theme_' . $theme ); |
9 | 268 |
$api = themes_api( |
269 |
'theme_information', |
|
270 |
array( |
|
271 |
'slug' => $theme, |
|
272 |
'fields' => array( |
|
273 |
'sections' => false, |
|
274 |
'tags' => false, |
|
275 |
), |
|
276 |
) |
|
16 | 277 |
); // Save on a bit of bandwidth. |
0 | 278 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
279 |
if ( is_wp_error( $api ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
280 |
wp_die( $api ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
281 |
} |
0 | 282 |
|
19 | 283 |
// Used in the HTML title tag. |
9 | 284 |
$title = __( 'Install Themes' ); |
285 |
$parent_file = 'themes.php'; |
|
0 | 286 |
$submenu_file = 'themes.php'; |
19 | 287 |
|
16 | 288 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 289 |
|
16 | 290 |
/* translators: %s: Theme name and version. */ |
9 | 291 |
$title = sprintf( __( 'Installing Theme: %s' ), $api->name . ' ' . $api->version ); |
0 | 292 |
$nonce = 'install-theme_' . $theme; |
9 | 293 |
$url = 'update.php?action=install-theme&theme=' . urlencode( $theme ); |
16 | 294 |
$type = 'web'; // Install theme type, From Web or an Upload. |
0 | 295 |
|
9 | 296 |
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) ); |
297 |
$upgrader->install( $api->download_link ); |
|
0 | 298 |
|
16 | 299 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
0 | 300 |
|
16 | 301 |
} elseif ( 'upload-theme' === $action ) { |
0 | 302 |
|
5 | 303 |
if ( ! current_user_can( 'upload_themes' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
304 |
wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); |
5 | 305 |
} |
0 | 306 |
|
9 | 307 |
check_admin_referer( 'theme-upload' ); |
0 | 308 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
309 |
if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
310 |
wp_die( __( 'Only .zip archives may be uploaded.' ) ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
311 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
312 |
|
9 | 313 |
$file_upload = new File_Upload_Upgrader( 'themezip', 'package' ); |
0 | 314 |
|
19 | 315 |
// Used in the HTML title tag. |
9 | 316 |
$title = __( 'Upload Theme' ); |
317 |
$parent_file = 'themes.php'; |
|
0 | 318 |
$submenu_file = 'theme-install.php'; |
319 |
||
16 | 320 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 321 |
|
16 | 322 |
/* translators: %s: File name. */ |
323 |
$title = sprintf( __( 'Installing theme from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) ); |
|
0 | 324 |
$nonce = 'theme-upload'; |
9 | 325 |
$url = add_query_arg( array( 'package' => $file_upload->id ), 'update.php?action=upload-theme' ); |
16 | 326 |
$type = 'upload'; // Install theme type, From Web or an Upload. |
0 | 327 |
|
16 | 328 |
$overwrite = isset( $_GET['overwrite'] ) ? sanitize_text_field( $_GET['overwrite'] ) : ''; |
329 |
$overwrite = in_array( $overwrite, array( 'update-theme', 'downgrade-theme' ), true ) ? $overwrite : ''; |
|
330 |
||
331 |
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact( 'type', 'title', 'nonce', 'url', 'overwrite' ) ) ); |
|
332 |
$result = $upgrader->install( $file_upload->package, array( 'overwrite_package' => $overwrite ) ); |
|
0 | 333 |
|
9 | 334 |
if ( $result || is_wp_error( $result ) ) { |
0 | 335 |
$file_upload->cleanup(); |
9 | 336 |
} |
0 | 337 |
|
16 | 338 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
339 |
||
340 |
} elseif ( 'upload-theme-cancel-overwrite' === $action ) { |
|
341 |
if ( ! current_user_can( 'upload_themes' ) ) { |
|
342 |
wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); |
|
343 |
} |
|
344 |
||
345 |
check_admin_referer( 'theme-upload-cancel-overwrite' ); |
|
0 | 346 |
|
16 | 347 |
// Make sure the attachment still exists, or File_Upload_Upgrader will call wp_die() |
348 |
// that shows a generic "Please select a file" error. |
|
349 |
if ( ! empty( $_GET['package'] ) ) { |
|
350 |
$attachment_id = (int) $_GET['package']; |
|
351 |
||
352 |
if ( get_post( $attachment_id ) ) { |
|
353 |
$file_upload = new File_Upload_Upgrader( 'themezip', 'package' ); |
|
354 |
$file_upload->cleanup(); |
|
355 |
} |
|
356 |
} |
|
357 |
||
358 |
wp_redirect( self_admin_url( 'theme-install.php' ) ); |
|
359 |
exit; |
|
0 | 360 |
} else { |
5 | 361 |
/** |
362 |
* Fires when a custom plugin or theme update request is received. |
|
363 |
* |
|
364 |
* The dynamic portion of the hook name, `$action`, refers to the action |
|
365 |
* provided in the request for wp-admin/update.php. Can be used to |
|
366 |
* provide custom update functionality for themes and plugins. |
|
367 |
* |
|
368 |
* @since 2.8.0 |
|
369 |
*/ |
|
16 | 370 |
do_action( "update-custom_{$action}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
0 | 371 |
} |
372 |
} |