Skip to content

Commit

Permalink
Merge branch 'WordPress:trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
ootwch authored Nov 4, 2022
2 parents 2910218 + 001528d commit 8d82821
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wp-includes/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ function _wp_build_title_and_description_for_taxonomy_block_template( $taxonomy,
$args = wp_parse_args( $args, $default_args );
$terms_query = $term_query->query( $args );

if ( empty( $terms_query->terms ) ) {
if ( empty( $terms_query ) ) {
$template->title = sprintf(
/* translators: Custom template title in the Site Editor, referencing a taxonomy term that was not found. 1: Taxonomy singular name, 2: Term slug. */
__( 'Not found: %1$s (%2$s)' ),
Expand All @@ -647,7 +647,7 @@ function _wp_build_title_and_description_for_taxonomy_block_template( $taxonomy,
return false;
}

$term_title = $terms_query->terms[0]->name;
$term_title = $terms_query[0]->name;

$template->title = sprintf(
/* translators: Custom template title in the Site Editor. 1: Taxonomy singular name, 2: Term title. */
Expand All @@ -671,7 +671,7 @@ function _wp_build_title_and_description_for_taxonomy_block_template( $taxonomy,
$args = wp_parse_args( $args, $default_args );
$terms_with_same_title_query = $term_query->query( $args );

if ( count( $terms_with_same_title_query->terms ) > 1 ) {
if ( count( $terms_with_same_title_query ) > 1 ) {
$template->title = sprintf(
/* translators: Custom template title in the Site Editor. 1: Template title, 2: Term slug. */
__( '%1$s (%2$s)' ),
Expand Down

0 comments on commit 8d82821

Please sign in to comment.