Skip to content

Commit

Permalink
Plugin: Deprecate gutenberg_content_block_version
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jan 24, 2019
1 parent 0259f7b commit 1537d5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The Gutenberg project's deprecation policy is intended to support backward compa
- The PHP function `gutenberg_register_post_prepare_functions` has been removed.
- The PHP function `gutenberg_silence_rest_errors` has been removed.
- The PHP function `gutenberg_filter_post_type_labels` 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.

## 4.5.0
- `Dropdown.refresh()` has been deprecated as the contained `Popover` is now automatically refreshed.
Expand Down
5 changes: 4 additions & 1 deletion lib/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,15 @@ function has_block( $block_type, $post = null ) {
*
* @since 2.8.0
* @see gutenberg_content_has_blocks()
* @deprecated 5.0.0 block_version
*
* @param string $content Content to test.
* @return int The block format version.
*/
function gutenberg_content_block_version( $content ) {
return has_blocks( $content ) ? 1 : 0;
_deprecated_function( __FUNCTION__, '5.0.0', 'block_version' );

return block_version( $content );
}

/**
Expand Down

0 comments on commit 1537d5e

Please sign in to comment.