diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
commit | 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch) | |
tree | 39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-admin/includes/theme.php | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip |
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-admin/includes/theme.php')
-rw-r--r-- | wp-admin/includes/theme.php | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index f822e57..36dc28b 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -66,7 +66,7 @@ function delete_theme( $stylesheet, $redirect = '' ) { return new WP_Error( 'fs_error', __( 'Filesystem error.' ), $wp_filesystem->errors ); } - // Get the base plugin folder. + // Get the base theme folder. $themes_dir = $wp_filesystem->wp_themes_dir(); if ( empty( $themes_dir ) ) { return new WP_Error( 'fs_no_themes_dir', __( 'Unable to locate WordPress theme directory.' ) ); @@ -114,6 +114,7 @@ function delete_theme( $stylesheet, $redirect = '' ) { foreach ( $translations as $translation => $data ) { $wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.po' ); $wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.mo' ); + $wp_filesystem->delete( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '.l10n.php' ); $json_translation_files = glob( WP_LANG_DIR . '/themes/' . $stylesheet . '-' . $translation . '-*.json' ); if ( $json_translation_files ) { @@ -447,7 +448,7 @@ function get_theme_feature_list( $api = true ) { * * @since 2.8.0 * - * @param string $action API action to perform: 'query_themes', 'theme_information', + * @param string $action API action to perform: Accepts 'query_themes', 'theme_information', * 'hot_tags' or 'feature_list'. * @param array|object $args { * Optional. Array or object of arguments to serialize for the Themes API. Default empty array. @@ -1110,6 +1111,8 @@ function customize_themes_print_templates() { * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_themes + * * @param string $theme Path to the theme directory relative to the themes directory. * @return bool True, if in the list of paused themes. False, not in the list. */ @@ -1130,6 +1133,8 @@ function is_theme_paused( $theme ) { * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_themes + * * @param string $theme Path to the theme directory relative to the themes * directory. * @return array|false Array of error information as it was returned by @@ -1159,12 +1164,17 @@ function wp_get_theme_error( $theme ) { * * @since 5.2.0 * + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. + * * @param string $theme Single theme to resume. * @param string $redirect Optional. URL to redirect to. Default empty string. * @return bool|WP_Error True on success, false if `$theme` was not paused, * `WP_Error` on failure. */ function resume_theme( $theme, $redirect = '' ) { + global $wp_stylesheet_path, $wp_template_path; + list( $extension ) = explode( '/', $theme ); /* @@ -1172,14 +1182,11 @@ function resume_theme( $theme, $redirect = '' ) { * creating a fatal error. */ if ( ! empty( $redirect ) ) { - $stylesheet_path = get_stylesheet_directory(); - $template_path = get_template_directory(); - $functions_path = ''; - if ( str_contains( $stylesheet_path, $extension ) ) { - $functions_path = $stylesheet_path . '/functions.php'; - } elseif ( str_contains( $template_path, $extension ) ) { - $functions_path = $template_path . '/functions.php'; + if ( str_contains( $wp_stylesheet_path, $extension ) ) { + $functions_path = $wp_stylesheet_path . '/functions.php'; + } elseif ( str_contains( $wp_template_path, $extension ) ) { + $functions_path = $wp_template_path . '/functions.php'; } if ( ! empty( $functions_path ) ) { @@ -1218,7 +1225,8 @@ function resume_theme( $theme, $redirect = '' ) { * * @since 5.2.0 * - * @global string $pagenow The filename of the current screen. + * @global string $pagenow The filename of the current screen. + * @global WP_Paused_Extensions_Storage $_paused_themes */ function paused_themes_notice() { if ( 'themes.php' === $GLOBALS['pagenow'] ) { |