Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stub editor settings override
  • Loading branch information
ironprogrammer committed Dec 5, 2022
commit b7e1b4ec4b48f3b0f174a3ae1c3e65dd379d6e4f
13 changes: 13 additions & 0 deletions hotfix-56970.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function wp_hotfix_56970_init() {
add_action( 'wp_enqueue_scripts', 'wp_hotfix_611_enqueue_global_styles' );
add_action( 'wp_footer', 'wp_hotfix_611_enqueue_global_styles', 1 );

// Hook override for block editor styles.
add_filter( 'block_editor_settings_all', 'wp_hotfix_611_get_block_editor_settings', PHP_INT_MAX );

// Unhook default cache cleaning mechanism.
remove_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
remove_action( 'start_previewing_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
Expand Down Expand Up @@ -159,6 +162,16 @@ function wp_hotfix_611_get_global_stylesheet( $types = array() ) {
return $stylesheet;
}

/**
* Add styles to the block editor settings.
*
* @param array $settings Existing block editor settings.
* @return array New block editor settings.
*/
function wp_hotfix_611_get_block_editor_settings( $settings ) {
return $settings;
}

/**
* Clean the caches under the theme_json group.
*/
Expand Down