diff --git a/docs/designers-developers/developers/backward-compatibility/deprecations.md b/docs/designers-developers/developers/backward-compatibility/deprecations.md index 03608d2634ff51..699dd190cd885f 100644 --- a/docs/designers-developers/developers/backward-compatibility/deprecations.md +++ b/docs/designers-developers/developers/backward-compatibility/deprecations.md @@ -23,6 +23,7 @@ The Gutenberg project's deprecation policy is intended to support backward compa - The PHP function `gutenberg_filter_post_type_labels` has been removed. - The PHP function `gutenberg_preload_api_request` has been removed. Use [`rest_preload_api_request`](https://developer.wordpress.org/reference/functions/rest_preload_api_request/) instead. - The PHP function `gutenberg_remove_wpcom_markdown_support` has been removed. +- The PHP function `gutenberg_add_gutenberg_post_state` has been removed. - The PHP function `gutenberg_bulk_post_updated_messages` has been removed. - The PHP function `gutenberg_kses_allowedtags` has been removed. - The PHP function `gutenberg_add_responsive_body_class` has been removed. diff --git a/lib/register.php b/lib/register.php index 0d6497ca6274cf..17694855511f84 100644 --- a/lib/register.php +++ b/lib/register.php @@ -369,18 +369,16 @@ function gutenberg_content_block_version( $content ) { /** * Adds a "Gutenberg" post state for post tables, if the post contains blocks. * - * @param array $post_states An array of post display states. - * @param WP_Post $post The current post object. - * @return array A filtered array of post display states. + * @deprecated 5.0.0 + * + * @param array $post_states An array of post display states. + * @return array A filtered array of post display states. */ -function gutenberg_add_gutenberg_post_state( $post_states, $post ) { - if ( has_blocks( $post ) ) { - $post_states[] = 'Gutenberg'; - } +function gutenberg_add_gutenberg_post_state( $post_states ) { + _deprecated_function( __FUNCTION__, '5.0.0' ); return $post_states; } -add_filter( 'display_post_states', 'gutenberg_add_gutenberg_post_state', 10, 2 ); /** * Registers custom post types required by the Gutenberg editor. diff --git a/phpunit/class-admin-test.php b/phpunit/class-admin-test.php index b13995af523009..f801df79e4f165 100644 --- a/phpunit/class-admin-test.php +++ b/phpunit/class-admin-test.php @@ -141,21 +141,6 @@ function test_gutenberg_content_has_blocks() { $this->assertFalse( gutenberg_content_has_blocks( $content_without_blocks ) ); } - /** - * Tests gutenberg_add_gutenberg_post_state(). - * - * @covers ::gutenberg_add_gutenberg_post_state - */ - function test_add_gutenberg_post_state() { - // With blocks. - $post_states = apply_filters( 'display_post_states', array(), get_post( self::$post_with_blocks ) ); - $this->assertEquals( array( 'Gutenberg' ), $post_states ); - - // Without blocks. - $post_states = apply_filters( 'display_post_states', array(), get_post( self::$post_without_blocks ) ); - $this->assertEquals( array(), $post_states ); - } - /** * Test that the revisions 'return to editor' links are set correctly for Classic & Gutenberg editors. *