PATH:
home
/
lab2454c
/
baas.elementalrock.com
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/post-author` block. * * @package WordPress */ /** * Renders the `core/post-author` 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 rendered author block. */ function render_block_core_post_author( $attributes, $content, $block ) { if ( ! isset( $block->context['postId'] ) ) { return ''; } $author_id = get_post_field( 'post_author', $block->context['postId'] ); if ( empty( $author_id ) ) { return ''; } $avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar( $author_id, $attributes['avatarSize'] ) : null; $byline = ! empty( $attributes['byline'] ) ? $attributes['byline'] : false; $classes = array_merge( isset( $attributes['className'] ) ? array( $attributes['className'] ) : array(), isset( $attributes['itemsJustification'] ) ? array( 'items-justified-' . $attributes['itemsJustification'] ) : array(), isset( $attributes['textAlign'] ) ? array( 'has-text-align-' . $attributes['textAlign'] ) : array() ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); return sprintf( '<div %1$s>', $wrapper_attributes ) . ( ! empty( $attributes['showAvatar'] ) ? '<div class="wp-block-post-author__avatar">' . $avatar . '</div>' : '' ) . '<div class="wp-block-post-author__content">' . ( ! empty( $byline ) ? '<p class="wp-block-post-author__byline">' . $byline . '</p>' : '' ) . '<p class="wp-block-post-author__name">' . get_the_author_meta( 'display_name', $author_id ) . '</p>' . ( ! empty( $attributes['showBio'] ) ? '<p class="wp-block-post-author__bio">' . get_the_author_meta( 'user_description', $author_id ) . '</p>' : '' ) . '</div>' . '</div>'; } /** * Registers the `core/post-author` block on the server. */ function register_block_core_post_author() { register_block_type_from_metadata( __DIR__ . '/post-author', array( 'render_callback' => 'render_block_core_post_author', ) ); } add_action( 'init', 'register_block_core_post_author' );
[+]
post-content
[+]
post-comments
[+]
search
[+]
image
[+]
column
[+]
latest-comments
[-] post-navigation-link.php
[edit]
[+]
term-description
[+]
quote
[+]
audio
[+]
social-links
[-] site-title.php
[edit]
[-] search.php
[edit]
[+]
shortcode
[-] block.php
[edit]
[-] term-description.php
[edit]
[-] index.php
[edit]
[+]
navigation-submenu
[+]
widget-group
[+]
..
[-] pattern.php
[edit]
[-] post-title.php
[edit]
[+]
heading
[-] post-excerpt.php
[edit]
[-] widget-group.php
[edit]
[+]
query-title
[+]
button
[+]
separator
[+]
spacer
[-] query-pagination-next.php
[edit]
[-] post-featured-image.php
[edit]
[+]
embed
[+]
query-pagination-next
[+]
text-columns
[+]
tag-cloud
[+]
more
[+]
site-title
[+]
site-tagline
[-] query-pagination-previous.php
[edit]
[-] tag-cloud.php
[edit]
[-] social-link.php
[edit]
[+]
cover
[-] rss.php
[edit]
[-] template-part.php
[edit]
[-] categories.php
[edit]
[+]
nextpage
[-] post-date.php
[edit]
[+]
code
[+]
columns
[+]
categories
[+]
loginout
[-] calendar.php
[edit]
[+]
media-text
[+]
preformatted
[-] post-comments.php
[edit]
[+]
legacy-widget
[-] latest-comments.php
[edit]
[-] navigation.php
[edit]
[+]
rss
[+]
archives
[+]
group
[-] navigation-link.php
[edit]
[+]
navigation-link
[+]
template-part
[+]
post-navigation-link
[-] site-logo.php
[edit]
[-] shortcode.php
[edit]
[+]
post-title
[-] file.php
[edit]
[-] query.php
[edit]
[+]
post-excerpt
[+]
block
[+]
post-template
[+]
query
[+]
pattern
[+]
latest-posts
[-] query-pagination-numbers.php
[edit]
[-] post-terms.php
[edit]
[+]
table
[-] page-list.php
[edit]
[-] site-tagline.php
[edit]
[+]
video
[+]
paragraph
[-] latest-posts.php
[edit]
[+]
query-pagination-previous
[+]
post-date
[+]
verse
[+]
file
[+]
social-link
[+]
query-pagination
[-] post-content.php
[edit]
[+]
buttons
[-] post-template.php
[edit]
[-] archives.php
[edit]
[+]
calendar
[-] post-author.php
[edit]
[+]
list
[+]
page-list
[+]
missing
[+]
pullquote
[+]
post-featured-image
[-] query-title.php
[edit]
[+]
post-author
[-] query-pagination.php
[edit]
[+]
site-logo
[+]
navigation
[-] loginout.php
[edit]
[-] navigation-submenu.php
[edit]
[-] legacy-widget.php
[edit]
[+]
post-terms
[+]
query-pagination-numbers
[+]
freeform
[+]
gallery
[-] image.php
[edit]
[-] gallery.php
[edit]
[+]
html