From 18608ce9de283f5bbcc5348ee444428f60687638 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 23 Jan 2019 21:27:13 -0500 Subject: [PATCH] Plugin: Remove core-defined block detection functions --- lib/register.php | 55 ------------------------------------------------ 1 file changed, 55 deletions(-) diff --git a/lib/register.php b/lib/register.php index b86df4fd7a37f0..81ef04ec95be16 100644 --- a/lib/register.php +++ b/lib/register.php @@ -310,32 +310,6 @@ function gutenberg_can_edit_post_type( $post_type ) { return apply_filters( 'gutenberg_can_edit_post_type', $can_edit, $post_type ); } -if ( ! function_exists( 'has_blocks' ) ) { - /** - * Determine whether a post or content string has blocks. - * - * This test optimizes for performance rather than strict accuracy, detecting - * the pattern of a block but not validating its structure. For strict accuracy - * you should use the block parser on post content. - * - * @since 3.6.0 - * @see gutenberg_parse_blocks() - * - * @param int|string|WP_Post|null $post Optional. Post content, post ID, or post object. Defaults to global $post. - * @return bool Whether the post has blocks. - */ - function has_blocks( $post = null ) { - if ( ! is_string( $post ) ) { - $wp_post = get_post( $post ); - if ( $wp_post instanceof WP_Post ) { - $post = $wp_post->post_content; - } - } - - return false !== strpos( (string) $post, '