Skip to content

Commit

Permalink
Refactor the hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar committed Dec 18, 2024
1 parent e34dc19 commit f7c6d87
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static function load_features() {
require_once __DIR__ . '/features/wpcom-admin-dashboard/wpcom-admin-dashboard.php';
require_once __DIR__ . '/features/wpcom-block-editor/class-jetpack-wpcom-block-editor.php';
require_once __DIR__ . '/features/wpcom-block-editor/functions.editor-type.php';
require_once __DIR__ . '/features/wpcom-hotfixes/wpcom-hotfixes.php';
require_once __DIR__ . '/features/wpcom-logout/wpcom-logout.php';
require_once __DIR__ . '/features/wpcom-themes/wpcom-theme-fixes.php';

Expand All @@ -125,20 +126,6 @@ public static function load_features() {
if ( class_exists( 'Automattic\Jetpack\Scheduled_Updates' ) ) {
Scheduled_Updates::init();
}

/**
* Hotfix for a Gutenberg 19.8.0 bug preventing lower-capability users from editing pages.
* See: p1734525664059729-slack-C02FMH4G8
* See: https://github.com/WordPress/gutenberg/issues/68053#issuecomment-2550730705
*/
add_filter(
'register_post_type_args',
function ( $args ) {
unset( $args['default_rendering_mode'] );
return $args;
},
20
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* Various hotfixes to WordPress.com
*
* @package automattic/jetpack-mu-wpcom
*/

/**
* Hotfix for a Gutenberg 19.8.0 bug preventing lower-capability users from editing pages.
* See: p1734525664059729-slack-C02FMH4G8
* See: https://github.com/WordPress/gutenberg/issues/68053#issuecomment-2550730705
*/
add_action(
'admin_init',
function () {
add_filter(
'register_post_type_args',
function ( $args ) {
unset( $args['default_rendering_mode'] );
return $args;
},
20
);
}
);

0 comments on commit f7c6d87

Please sign in to comment.