PATH:
home
/
bkunreyz
/
ps.fleetwoodislamiccentre.com
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/post-title` block. * * @package WordPress */ /** * Renders the `core/post-title` block on the server. * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. * * @return string Returns the filtered post title for the current post wrapped inside "h1" tags. */ function render_block_core_post_title( $attributes, $content, $block ) { if ( ! isset( $block->context['postId'] ) ) { return ''; } $post_ID = $block->context['postId']; $tag_name = 'h2'; $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; if ( isset( $attributes['level'] ) ) { $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level']; } $title = get_the_title( $post_ID ); if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { $title = sprintf( '<a href="%1s" target="%2s" rel="%3s">%4s</a>', get_the_permalink( $post_ID ), $attributes['linkTarget'], $attributes['rel'], $title ); } $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 ); } /** * Registers the `core/post-title` block on the server. */ function register_block_core_post_title() { register_block_type_from_metadata( __DIR__ . '/post-title', array( 'render_callback' => 'render_block_core_post_title', ) ); } add_action( 'init', 'register_block_core_post_title' );
[+]
group
[-] post-content.php
[edit]
[+]
list
[+]
post-template
[+]
freeform
[+]
post-terms
[+]
legacy-widget
[+]
site-logo
[+]
calendar
[+]
columns
[-] query-pagination-next.php
[edit]
[-] calendar.php
[edit]
[-] query-pagination-previous.php
[edit]
[+]
image
[+]
file
[-] post-excerpt.php
[edit]
[+]
pullquote
[-] site-title.php
[edit]
[+]
query-pagination-next
[+]
block
[+]
query-title
[+]
latest-comments
[+]
missing
[-] post-terms.php
[edit]
[-] file.php
[edit]
[+]
heading
[-] tag-cloud.php
[edit]
[-] legacy-widget.php
[edit]
[+]
query-pagination-previous
[+]
loginout
[+]
gallery
[+]
cover
[+]
query-pagination
[-] latest-posts.php
[edit]
[-] rss.php
[edit]
[+]
buttons
[+]
post-date
[+]
shortcode
[-] index.php
[edit]
[+]
spacer
[+]
post-title
[-] search.php
[edit]
[+]
quote
[+]
nextpage
[+]
search
[+]
tag-cloud
[-] site-tagline.php
[edit]
[-] post-template.php
[edit]
[+]
..
[+]
post-featured-image
[+]
text-columns
[+]
rss
[+]
embed
[-] loginout.php
[edit]
[-] query-pagination-numbers.php
[edit]
[+]
latest-posts
[+]
post-excerpt
[+]
preformatted
[+]
html
[-] social-link.php
[edit]
[-] categories.php
[edit]
[-] page-list.php
[edit]
[+]
query
[+]
media-text
[+]
social-link
[+]
video
[-] post-featured-image.php
[edit]
[-] shortcode.php
[edit]
[+]
more
[+]
post-content
[-] post-date.php
[edit]
[+]
social-links
[+]
query-pagination-numbers
[+]
separator
[+]
paragraph
[+]
site-tagline
[+]
audio
[+]
button
[+]
code
[+]
categories
[-] query-pagination.php
[edit]
[-] latest-comments.php
[edit]
[+]
table
[-] post-title.php
[edit]
[+]
page-list
[+]
verse
[+]
site-title
[+]
archives
[+]
column