rebase on oct-10-2023
This commit is contained in:
@@ -711,16 +711,21 @@ function wp_prepare_themes_for_js( $themes = null ) {
|
||||
$is_block_theme = $theme->is_block_theme();
|
||||
|
||||
if ( $is_block_theme && $can_edit_theme_options ) {
|
||||
$customize_action = esc_url( admin_url( 'site-editor.php' ) );
|
||||
$customize_action = admin_url( 'site-editor.php' );
|
||||
if ( $current_theme !== $slug ) {
|
||||
$customize_action = add_query_arg( 'wp_theme_preview', $slug, $customize_action );
|
||||
}
|
||||
} elseif ( ! $is_block_theme && $can_customize && $can_edit_theme_options ) {
|
||||
$customize_action = esc_url(
|
||||
add_query_arg(
|
||||
array(
|
||||
'return' => urlencode( sanitize_url( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ),
|
||||
),
|
||||
wp_customize_url( $slug )
|
||||
)
|
||||
$customize_action = wp_customize_url( $slug );
|
||||
}
|
||||
if ( null !== $customize_action ) {
|
||||
$customize_action = add_query_arg(
|
||||
array(
|
||||
'return' => urlencode( sanitize_url( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ),
|
||||
),
|
||||
$customize_action
|
||||
);
|
||||
$customize_action = esc_url( $customize_action );
|
||||
}
|
||||
|
||||
$update_requires_wp = isset( $updates[ $slug ]['requires'] ) ? $updates[ $slug ]['requires'] : null;
|
||||
@@ -1162,9 +1167,9 @@ function resume_theme( $theme, $redirect = '' ) {
|
||||
*/
|
||||
if ( ! empty( $redirect ) ) {
|
||||
$functions_path = '';
|
||||
if ( strpos( STYLESHEETPATH, $extension ) ) {
|
||||
if ( str_contains( STYLESHEETPATH, $extension ) ) {
|
||||
$functions_path = STYLESHEETPATH . '/functions.php';
|
||||
} elseif ( strpos( TEMPLATEPATH, $extension ) ) {
|
||||
} elseif ( str_contains( TEMPLATEPATH, $extension ) ) {
|
||||
$functions_path = TEMPLATEPATH . '/functions.php';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user