From dc47154d7cd4730ddae9c7af062c06f85509d641 Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Thu, 16 Jan 2025 16:11:26 +1300 Subject: [PATCH] Only run GB 19.8 hotfix for non-admin users (#41110) --- .../jetpack-mu-wpcom/changelog/hotfix-template-locked-bug-2 | 4 ++++ .../src/features/wpcom-hotfixes/wpcom-hotfixes.php | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/hotfix-template-locked-bug-2 diff --git a/projects/packages/jetpack-mu-wpcom/changelog/hotfix-template-locked-bug-2 b/projects/packages/jetpack-mu-wpcom/changelog/hotfix-template-locked-bug-2 new file mode 100644 index 0000000000000..70a65c6361a3e --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/hotfix-template-locked-bug-2 @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +GB 19.8.0 hotfix: further refine hotfix so site editor opens correct template by default diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-hotfixes/wpcom-hotfixes.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-hotfixes/wpcom-hotfixes.php index 199033db6b7f5..5b50ae0ea76d0 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-hotfixes/wpcom-hotfixes.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-hotfixes/wpcom-hotfixes.php @@ -13,6 +13,12 @@ add_filter( 'register_post_type_args', function ( $args ) { + if ( current_user_can( 'manage_options' ) ) { + // Admins still need default_rendering_mode for the site editor to select the correct default template. + // See: p1736989403607879-slack-C02FMH4G8 + return $args; + } + unset( $args['default_rendering_mode'] ); return $args; },