From 659ca2bd1ebef5ba4c99ee8ac6646f1c102bf238 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 17 Dec 2018 03:19:38 +0000 Subject: [PATCH] Tests: Fix tests broken in PHP 5.x after [43879]. Props pento. Merges [43883] to trunk. See #45290. Built from https://develop.svn.wordpress.org/trunk@44242 git-svn-id: http://core.svn.wordpress.org/trunk@44072 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 5 +++++ wp-includes/blocks.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index aba113c7a5..f76f16e625 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -2045,6 +2045,11 @@ function use_block_editor_for_post( $post ) { return false; } + // The posts page can't be edited in the block editor. + if ( absint( get_option( 'page_for_posts' ) ) === $post->ID && empty( $post->post_content ) ) { + return false; + } + $use_block_editor = use_block_editor_for_post_type( $post->post_type ); /** diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index e817286ff7..fe83ef7750 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -222,7 +222,7 @@ function do_blocks( $content ) { */ function _restore_wpautop_hook( $content ) { global $wp_filter; - $current_priority = $wp_filter['the_content']->current_priority(); + $current_priority = has_filter( 'the_content', '_restore_wpautop_hook' ); add_filter( 'the_content', 'wpautop', $current_priority - 1 ); remove_filter( 'the_content', '_restore_wpautop_hook', $current_priority ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 4370a3dabe..6e8b1a288d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44241'; +$wp_version = '5.1-alpha-44242'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.