diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index fa32393290..ecdd8ec8fd 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -88,7 +88,7 @@ function get_block_templates( $query = array(), $template_type = 'wp_template' ) $template_query = new WP_Query( $wp_query_args ); $query_result = array(); - foreach ( $template_query->get_posts() as $post ) { + foreach ( $template_query->posts as $post ) { $template = _build_template_result_from_post( $post ); if ( ! is_wp_error( $template ) ) { @@ -130,7 +130,7 @@ function get_block_template( $id, $template_type = 'wp_template' ) { ), ); $template_query = new WP_Query( $wp_query_args ); - $posts = $template_query->get_posts(); + $posts = $template_query->posts; if ( count( $posts ) > 0 ) { $template = _build_template_result_from_post( $posts[0] ); diff --git a/src/wp-includes/theme-templates.php b/src/wp-includes/theme-templates.php index 5cce35cd99..f5e03c5786 100644 --- a/src/wp-includes/theme-templates.php +++ b/src/wp-includes/theme-templates.php @@ -49,7 +49,7 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID ), ); $check_query = new WP_Query( $check_query_args ); - $posts = $check_query->get_posts(); + $posts = $check_query->posts; if ( count( $posts ) > 0 ) { $suffix = 2; @@ -59,7 +59,7 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID $query_args['post_name__in'] = array( $alt_post_name ); $query = new WP_Query( $query_args ); $suffix++; - } while ( count( $query->get_posts() ) > 0 ); + } while ( count( $query->posts ) > 0 ); $override_slug = $alt_post_name; }