Ticket #45348: 45348.diff
File 45348.diff, 2.4 KB (added by , 6 years ago) |
---|
-
src/wp-admin/edit-form-blocks.php
325 325 'post' => $post->ID, 326 326 ) 327 327 ); 328 wp_tinymce_inline_scripts(); 328 329 wp_enqueue_editor(); 329 330 330 331 /** -
src/wp-includes/script-loader.php
484 484 'window.wp.oldEditor = window.wp.editor;', 485 485 'after' 486 486 ); 487 } 487 488 488 // TinyMCE init. 489 /** 490 * Adds inline scripts required for the TinyMCE in the block editor. 491 * 492 * These TinyMCE init settings are used to extend and override the default settings 493 * from `_WP_Editors::default_settings()` for the Classic block. 494 * 495 * @since 5.0.0 496 * 497 * @global WP_Scripts $wp_scripts 498 */ 499 function wp_tinymce_inline_scripts() { 500 global $wp_scripts; 501 502 /** This filter is documented in wp-includes/class-wp-editor.php */ 503 $editor_settings = apply_filters( 'wp_editor_settings', array( 'tinymce' => true ), 'classic-block' ); 504 489 505 $tinymce_plugins = array( 490 506 'charmap', 491 507 'colorpicker', … … 511 527 $tinymce_plugins = apply_filters( 'tiny_mce_plugins', $tinymce_plugins, 'classic-block' ); 512 528 $tinymce_plugins = array_unique( $tinymce_plugins ); 513 529 530 $disable_captions = false; 531 // Runs after `tiny_mce_plugins` but before `mce_buttons`. 532 /** This filter is documented in wp-admin/includes/media.php */ 533 if ( apply_filters( 'disable_captions', '' ) ) { 534 $disable_captions = true; 535 } 536 514 537 $toolbar1 = array( 515 538 'formatselect', 516 539 'bold', … … 565 588 'classic_block_editor' => true, 566 589 ); 567 590 591 if ( $disable_captions ) { 592 $tinymce_settings['wpeditimage_disable_captions'] = true; 593 } 594 595 if ( ! empty( $editor_settings['tinymce'] ) && is_array( $editor_settings['tinymce'] ) ) { 596 array_merge( $tinymce_settings, $editor_settings['tinymce'] ); 597 } 598 568 599 /* This filter is documented in wp-includes/class-wp-editor.php */ 569 600 $tinymce_settings = apply_filters( 'tiny_mce_before_init', $tinymce_settings, 'classic-block' ); 570 601 … … 596 627 } 597 628 }'; 598 629 599 $ scripts->add_inline_script( 'wp-block-library', $script, 'before' );630 $wp_scripts->add_inline_script( 'wp-block-library', $script, 'before' ); 600 631 } 601 632 602 633 /**