π File Manager
π Edit File: site-title.php
<?php /** * Server-side rendering of the `core/site-title` block. * * @package WordPress */ /** * Renders the `core/site-title` block on the server. * * @since 5.8.0 * * @param array $attributes The block attributes. * * @return string The render. */ function render_block_core_site_title( $attributes ) { $site_title = get_bloginfo( 'name' ); if ( ! $site_title ) { return; } $tag_name = 'h1'; $classes = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { $classes .= ' has-link-color'; } if ( isset( $attributes['level'] ) ) { $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . (int) $attributes['level']; } if ( $attributes['isLink'] ) { $aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : ''; $link_target = ! empty( $attributes['linkTarget'] ) ? $attributes['linkTarget'] : '_self'; $site_title = sprintf( '<a href="%1$s" target="%2$s" rel="home"%3$s>%4$s</a>', esc_url( home_url() ), esc_attr( $link_target ), $aria_current, esc_html( $site_title ) ); } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classes ) ) ); return sprintf( '<%1$s %2$s>%3$s</%1$s>', $tag_name, $wrapper_attributes, // already pre-escaped if it is a link. $attributes['isLink'] ? $site_title : esc_html( $site_title ) ); } /** * Registers the `core/site-title` block on the server. * * @since 5.8.0 */ function register_block_core_site_title() { register_block_type_from_metadata( __DIR__ . '/site-title', array( 'render_callback' => 'render_block_core_site_title', ) ); } add_action( 'init', 'register_block_core_site_title' );
Cancel
Type
Item Name
Actions
π
..
π
archives
βοΈ
π
audio
βοΈ
π
avatar
βοΈ
π
block
βοΈ
π
button
βοΈ
π
buttons
βοΈ
π
calendar
βοΈ
π
categories
βοΈ
π
code
βοΈ
π
column
βοΈ
π
columns
βοΈ
π
comment-author-name
βοΈ
π
comment-content
βοΈ
π
comment-date
βοΈ
π
comment-edit-link
βοΈ
π
comment-reply-link
βοΈ
π
comment-template
βοΈ
π
comments
βοΈ
π
comments-pagination
βοΈ
π
comments-pagination-next
βοΈ
π
comments-pagination-numbers
βοΈ
π
comments-pagination-previous
βοΈ
π
comments-title
βοΈ
π
cover
βοΈ
π
details
βοΈ
π
embed
βοΈ
π
file
βοΈ
π
footnotes
βοΈ
π
freeform
βοΈ
π
gallery
βοΈ
π
group
βοΈ
π
heading
βοΈ
π
home-link
βοΈ
π
html
βοΈ
π
image
βοΈ
π
latest-comments
βοΈ
π
latest-posts
βοΈ
π
legacy-widget
βοΈ
π
list
βοΈ
π
list-item
βοΈ
π
loginout
βοΈ
π
media-text
βοΈ
π
missing
βοΈ
π
more
βοΈ
π
navigation
βοΈ
π
navigation-link
βοΈ
π
navigation-submenu
βοΈ
π
nextpage
βοΈ
π
page-list
βοΈ
π
page-list-item
βοΈ
π
paragraph
βοΈ
π
pattern
βοΈ
π
post-author
βοΈ
π
post-author-biography
βοΈ
π
post-author-name
βοΈ
π
post-comments-form
βοΈ
π
post-content
βοΈ
π
post-date
βοΈ
π
post-excerpt
βοΈ
π
post-featured-image
βοΈ
π
post-navigation-link
βοΈ
π
post-template
βοΈ
π
post-terms
βοΈ
π
post-title
βοΈ
π
preformatted
βοΈ
π
pullquote
βοΈ
π
query
βοΈ
π
query-no-results
βοΈ
π
query-pagination
βοΈ
π
query-pagination-next
βοΈ
π
query-pagination-numbers
βοΈ
π
query-pagination-previous
βοΈ
π
query-title
βοΈ
π
quote
βοΈ
π
read-more
βοΈ
π
rss
βοΈ
π
search
βοΈ
π
separator
βοΈ
π
shortcode
βοΈ
π
site-logo
βοΈ
π
site-tagline
βοΈ
π
site-title
βοΈ
π
social-link
βοΈ
π
social-links
βοΈ
π
spacer
βοΈ
π
table
βοΈ
π
tag-cloud
βοΈ
π
template-part
βοΈ
π
term-description
βοΈ
π
text-columns
βοΈ
π
verse
βοΈ
π
video
βοΈ
π
widget-group
βοΈ
π
archives.php
βοΈ
π
π
avatar.php
βοΈ
π
π
block.php
βοΈ
π
π
blocks-json.php
βοΈ
π
π
button.php
βοΈ
π
π
calendar.php
βοΈ
π
π
categories.php
βοΈ
π
π
comment-author-name.php
βοΈ
π
π
comment-content.php
βοΈ
π
π
comment-date.php
βοΈ
π
π
comment-edit-link.php
βοΈ
π
π
comment-reply-link.php
βοΈ
π
π
comment-template.php
βοΈ
π
π
comments-pagination-next.php
βοΈ
π
π
comments-pagination-numbers.php
βοΈ
π
π
comments-pagination-previous.php
βοΈ
π
π
comments-pagination.php
βοΈ
π
π
comments-title.php
βοΈ
π
π
comments.php
βοΈ
π
π
cover.php
βοΈ
π
π
file.php
βοΈ
π
π
footnotes.php
βοΈ
π
π
gallery.php
βοΈ
π
π
heading.php
βοΈ
π
π
home-link.php
βοΈ
π
π
image.php
βοΈ
π
π
index.php
βοΈ
π
π
latest-comments.php
βοΈ
π
π
latest-posts.php
βοΈ
π
π
legacy-widget.php
βοΈ
π
π
list.php
βοΈ
π
π
loginout.php
βοΈ
π
π
media-text.php
βοΈ
π
π
navigation-link.php
βοΈ
π
π
navigation-submenu.php
βοΈ
π
π
navigation.php
βοΈ
π
π
page-list-item.php
βοΈ
π
π
page-list.php
βοΈ
π
π
pattern.php
βοΈ
π
π
post-author-biography.php
βοΈ
π
π
post-author-name.php
βοΈ
π
π
post-author.php
βοΈ
π
π
post-comments-form.php
βοΈ
π
π
post-content.php
βοΈ
π
π
post-date.php
βοΈ
π
π
post-excerpt.php
βοΈ
π
π
post-featured-image.php
βοΈ
π
π
post-navigation-link.php
βοΈ
π
π
post-template.php
βοΈ
π
π
post-terms.php
βοΈ
π
π
post-title.php
βοΈ
π
π
query-no-results.php
βοΈ
π
π
query-pagination-next.php
βοΈ
π
π
query-pagination-numbers.php
βοΈ
π
π
query-pagination-previous.php
βοΈ
π
π
query-pagination.php
βοΈ
π
π
query-title.php
βοΈ
π
π
query.php
βοΈ
π
π
read-more.php
βοΈ
π
π
require-dynamic-blocks.php
βοΈ
π
π
require-static-blocks.php
βοΈ
π
π
rss.php
βοΈ
π
π
search.php
βοΈ
π
π
shortcode.php
βοΈ
π
π
site-logo.php
βοΈ
π
π
site-tagline.php
βοΈ
π
π
site-title.php
βοΈ
π
π
social-link.php
βοΈ
π
π
tag-cloud.php
βοΈ
π
π
template-part.php
βοΈ
π
π
term-description.php
βοΈ
π
π
widget-group.php
βοΈ
π