Skip to content
Merged
Changes from all commits
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
39 changes: 0 additions & 39 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -1239,32 +1239,6 @@ function gutenberg_default_post_format_template( $settings, $post ) {
}
add_filter( 'block_editor_settings', 'gutenberg_default_post_format_template', 10, 2 );

/**
* The code editor settings that were last captured by
* gutenberg_capture_code_editor_settings().
*
* @var array|false
*/
$gutenberg_captured_code_editor_settings = false;

/**
* When passed to the wp_code_editor_settings filter, this function captures
* the code editor settings given to it and then prevents
* wp_enqueue_code_editor() from enqueuing any assets.
*
* This is a workaround until e.g. code_editor_settings() is added to Core.
*
* @since 2.1.0
*
* @param array $settings Code editor settings.
* @return false
*/
function gutenberg_capture_code_editor_settings( $settings ) {
global $gutenberg_captured_code_editor_settings;
$gutenberg_captured_code_editor_settings = $settings;
return false;
}

/**
* Retrieve a stored autosave that is newer than the post save.
*
Expand Down Expand Up @@ -1509,19 +1483,6 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
);
wp_localize_script( 'wp-editor', '_wpMetaBoxUrl', $meta_box_url );

// Populate default code editor settings by short-circuiting wp_enqueue_code_editor.
global $gutenberg_captured_code_editor_settings;
add_filter( 'wp_code_editor_settings', 'gutenberg_capture_code_editor_settings' );
wp_enqueue_code_editor( array( 'type' => 'text/html' ) );
remove_filter( 'wp_code_editor_settings', 'gutenberg_capture_code_editor_settings' );
wp_add_inline_script(
'wp-editor',
sprintf(
'window._wpGutenbergCodeEditorSettings = %s;',
wp_json_encode( $gutenberg_captured_code_editor_settings )
)
);

// Initialize the editor.
$gutenberg_theme_support = get_theme_support( 'gutenberg' );
$align_wide = get_theme_support( 'align-wide' );
Expand Down