Tests: Fix tests broken in PHP 5.x after [43879].

See #45290.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43883 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2018-11-09 09:43:29 +00:00
parent d02d1ea4df
commit ca69dd523b
2 changed files with 6 additions and 1 deletions

View File

@ -1896,6 +1896,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 );
/**

View File

@ -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 );