Skip to content

Commit

Permalink
Plugin: Deprecate gutenberg_add_gutenberg_post_state
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jan 24, 2019
1 parent 0259f7b commit 3b8f5e8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,18 +421,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.
Expand Down

0 comments on commit 3b8f5e8

Please sign in to comment.