wp-includes/blocks/query-title.php:21Renders the core/query-title block on the server.
$attributesarray$content$blockobjectstringfunction render_block_core_query_title( $attributes, $content, $block ) { $type = $attributes['type'] ?? null; $is_archive = is_archive(); $is_search = is_search(); $post_type = $block->context['query']['postType'] ?? get_post_type(); if ( ! $type || ( 'archive' === $type && ! $is_archive ) || ( 'search' === $type && ! $is_search ) || ( 'post-type' === $type && ! $post_type ) ) { return ''; } $title = ''; if ( $is_archive ) { $show_prefix = $attributes['showPrefix'] ?? true; if ( ! $show_prefix ) { add_filter( 'get_the_archive_title_prefix', '__return_empty_string', 1 ); $title = get_the_archive_title(); remove_filter( 'get_the_archive_title_prefix', '__return_empty_string', 1 ); } else { $title = get_the_archive_title(); } } if ( $is_search ) { $title = __( 'Search results' ); if ( isset( $attributes['showSearchTerm'] ) && $attributes['showSearchTerm'] ) { $title = sprintf( /* translators: %s is the search term. */ __( 'Search results for: “%s”' ), get_search_query() ); } } if ( 'post-type' === $type ) { $post_type_object = get_post_type_object( $post_type ); if ( ! $post_type_object ) { return ''; } $post_type_name = $post_type_object->labels->singular_name; $show_prefix = $attributes['showPrefix'] ?? true; if ( $show_prefix ) { $title = sprintf( /* translators: %s is the post type name. */ __( 'Post Type: “%s”' ), $post_type_name ); } else { $title = $post_type_name; } } $level = (int) ( $attributes['level'] ?? 1 ); $tag_name = 0 === $level ? 'p' : 'h' . $level; $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); return sprintf( '<%1$s %2$s>%3$s</%1$s>', $tag_name, $wrapper_attributes, $title );}Introduced in 5.8.0. 3 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$content retyped from untyped to array.verified against source$content added.verified against source$block added.verified against sourcesrc/wp-includes/blocks/query-title.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.