Skip to content

Commit

Permalink
Plugin: Deprecate register_tinymce_scripts (#13466)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored and youknowriad committed Mar 6, 2019
1 parent 6236137 commit 3ba2090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The Gutenberg project's deprecation policy is intended to support backward compa
- The PHP function `gutenberg_replace_default_add_new_button` has been removed.
- The PHP function `gutenberg_content_block_version` has been removed. Use [`block_version`](https://developer.wordpress.org/reference/functions/block_version/) instead.
- The PHP function `gutenberg_get_block_categories` has been removed. Use [`get_block_categories`](https://developer.wordpress.org/reference/functions/get_block_categories/) instead.
- The PHP function `register_tinymce_scripts` has been removed. Use [`wp_register_tinymce_scripts`](https://developer.wordpress.org/reference/functions/wp_register_tinymce_scripts/) instead.

## 4.5.0
- `Dropdown.refresh()` has been deprecated as the contained `Popover` is now automatically refreshed.
Expand Down
24 changes: 5 additions & 19 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,14 @@ function gutenberg_get_script_polyfill( $tests ) {
if ( ! function_exists( 'register_tinymce_scripts' ) ) {
/**
* Registers the main TinyMCE scripts.
*
* @deprecated 5.0.0 wp_register_tinymce_scripts
*/
function register_tinymce_scripts() {
global $tinymce_version, $concatenate_scripts, $compress_scripts;
if ( ! isset( $concatenate_scripts ) ) {
script_concat_settings();
}
$suffix = SCRIPT_DEBUG ? '' : '.min';
$compressed = $compress_scripts && $concatenate_scripts && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )
&& false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' );
// Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) or
// tinymce.min.js (when SCRIPT_DEBUG is true).
$mce_suffix = false !== strpos( get_bloginfo( 'version' ), '-src' ) ? '' : '.min';
if ( $compressed ) {
gutenberg_override_script( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array(), $tinymce_version );
} else {
gutenberg_override_script( 'wp-tinymce-root', includes_url( 'js/tinymce/' ) . "tinymce{$mce_suffix}.js", array(), $tinymce_version );
gutenberg_override_script( 'wp-tinymce', includes_url( 'js/tinymce/' ) . "plugins/compat3x/plugin{$suffix}.js", array( 'wp-tinymce-root' ), $tinymce_version );
}
_deprecated_function( __FUNCTION__, '5.0.0', 'wp_register_tinymce_scripts' );

gutenberg_override_script( 'wp-tinymce-lists', includes_url( 'js/tinymce/' ) . "plugins/lists/plugin{$suffix}.js", array( 'wp-tinymce' ), $tinymce_version );
global $wp_scripts;
return wp_register_tinymce_scripts( $wp_scripts );
}
}

Expand Down Expand Up @@ -167,8 +155,6 @@ function gutenberg_register_packages_scripts() {
function gutenberg_register_scripts_and_styles() {
gutenberg_register_vendor_scripts();

register_tinymce_scripts();

wp_add_inline_script(
'wp-polyfill',
gutenberg_get_script_polyfill(
Expand Down

0 comments on commit 3ba2090

Please sign in to comment.