Skip to content

Commit e16a4b0

Browse files
committed
[start-logic] [theme-preview] [fix] Apply the temporary patch only when WP version is between (inclusive) 6.3 and 6.3.1, after which the bug was fixed in the core (6.3.2+).
1 parent 952ad24 commit e16a4b0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

start.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* @var string
1717
*/
18-
$this_sdk_version = '2.6.0';
18+
$this_sdk_version = '2.6.0.1';
1919

2020
#region SDK Selection Logic --------------------------------------------------------------------
2121

@@ -47,15 +47,20 @@
4747
$file_path = fs_normalize_path( __FILE__ );
4848
$fs_root_path = dirname( $file_path );
4949

50+
// @todo: Remove this code after a few months when WP 6.3 usage is low enough.
51+
global $wp_version;
52+
5053
if (
5154
! function_exists( 'wp_get_current_user' ) &&
5255
/**
5356
* `get_stylesheet()` will rely on `wp_get_current_user()` when it is being filtered by `theme-previews.php`. That happens only when the site editor is loaded or when the site editor is sending REST requests.
5457
* @see theme-previews.php:wp_get_theme_preview_path()
5558
*
56-
* @todo If this behavior is fixed in the core, we will remove this workaround.
59+
* @todo This behavior is already fixed in the core (WP 6.3.2+), and this code can be removed after a few months when WP 6.3 usage is low enough.
5760
* @since WP 6.3.0
5861
*/
62+
version_compare( $wp_version, '6.3', '>=' ) &&
63+
version_compare( $wp_version, '6.3.1', '<=' ) &&
5964
(
6065
'site-editor.php' === basename( $_SERVER['SCRIPT_FILENAME'] ) ||
6166
(

0 commit comments

Comments
 (0)