Skip to content

Commit

Permalink
Plugin: Deprecate gutenberg_add_admin_body_class (#13572)
Browse files Browse the repository at this point in the history
* Plugin: Deprecate gutenberg_add_admin_body_class

* Plugin: Reference block-editor-page class for admin class removal
  • Loading branch information
aduth authored and youknowriad committed Mar 6, 2019
1 parent df53cc6 commit 65dd726
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The Gutenberg project's deprecation policy is intended to support backward compa
- The PHP function `gutenberg_collect_meta_box_data` has been removed. Use [`register_and_do_post_meta_boxes`](https://developer.wordpress.org/reference/functions/register_and_do_post_meta_boxes/) instead.
- `window._wpLoadGutenbergEditor` has been removed. Use `window._wpLoadBlockEditor` instead. Note: This is a private API, not intended for public use. It may be removed in the future.
- The PHP function `gutenberg_get_script_polyfill` has been removed. Use [`wp_get_script_polyfill`](https://developer.wordpress.org/reference/functions/wp_get_script_polyfill/) instead.
- The PHP function `gutenberg_add_admin_body_class` has been removed. Use the `.block-editor-page` class selector in your stylesheets if you need to scope styles to the block editor screen.

## 4.5.0
- `Dropdown.refresh()` has been deprecated as the contained `Popover` is now automatically refreshed.
Expand Down
12 changes: 4 additions & 8 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ function gutenberg_init( $return, $post ) {

add_action( 'admin_enqueue_scripts', 'gutenberg_editor_scripts_and_styles' );
add_filter( 'screen_options_show_screen', '__return_false' );
add_filter( 'admin_body_class', 'gutenberg_add_admin_body_class' );

/*
* Remove the emoji script as it is incompatible with both React and any
Expand Down Expand Up @@ -299,18 +298,15 @@ function gutenberg_replace_default_add_new_button() {
* Adds the block-editor-page class to the body tag on the Gutenberg page.
*
* @since 1.5.0
* @deprecated 5.0.0
*
* @param string $classes Space separated string of classes being added to the body tag.
* @return string The $classes string, with block-editor-page appended.
*/
function gutenberg_add_admin_body_class( $classes ) {
// gutenberg-editor-page is left for backward compatibility.
if ( current_theme_supports( 'editor-styles' ) && current_theme_supports( 'dark-editor-style' ) ) {
return "$classes block-editor-page gutenberg-editor-page is-fullscreen-mode wp-embed-responsive is-dark-theme";
} else {
// Default to is-fullscreen-mode to avoid jumps in the UI.
return "$classes block-editor-page gutenberg-editor-page is-fullscreen-mode wp-embed-responsive";
}
_deprecated_function( __FUNCTION__, '5.0.0' );

return $classes;
}

/**
Expand Down

0 comments on commit 65dd726

Please sign in to comment.