%PDF-
%PDF-
Mini Shell
Mini Shell
<?php
/**
* Server-side rendering of the `core/post-author` block.
*
* @package WordPress
*/
/**
* Renders the `core/post-author` block on the server.
*
* @since 5.9.0
*
* @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'] ) ) {
$author_id = get_query_var( 'author' );
} else {
$author_id = get_post_field( 'post_author', $block->context['postId'] );
}
if ( empty( $author_id ) ) {
return '';
}
if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) {
return '';
}
$avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar(
$author_id,
$attributes['avatarSize']
) : null;
$link = get_author_posts_url( $author_id );
$author_name = get_the_author_meta( 'display_name', $author_id );
if ( ! empty( $attributes['isLink'] && ! empty( $attributes['linkTarget'] ) ) ) {
$author_name = sprintf( '<a href="%1$s" target="%2$s">%3$s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $author_name );
}
$byline = ! empty( $attributes['byline'] ) ? $attributes['byline'] : false;
$classes = array();
if ( isset( $attributes['itemsJustification'] ) ) {
$classes[] = 'items-justified-' . $attributes['itemsJustification'];
}
if ( isset( $attributes['textAlign'] ) ) {
$classes[] = 'has-text-align-' . $attributes['textAlign'];
}
if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
$classes[] = 'has-link-color';
}
$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">' . wp_kses_post( $byline ) . '</p>' : '' ) .
'<p class="wp-block-post-author__name">' . $author_name . '</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.
*
* @since 5.9.0
*/
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' );
Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap241.xml
2026-12-01
https://louisvillegop.com/sitemap407.xml
2026-12-01
https://louisvillegop.com/sitemap599.xml
2026-12-01
https://louisvillegop.com/sitemap108.xml
2026-12-01
https://louisvillegop.com/sitemap600.xml
2026-12-01
https://louisvillegop.com/sitemap999.xml
2026-12-01
https://louisvillegop.com/sitemap55.xml
2026-12-01
https://louisvillegop.com/sitemap798.xml
2026-12-01
https://louisvillegop.com/sitemap392.xml
2026-12-01
https://louisvillegop.com/sitemap498.xml
2026-12-01
https://louisvillegop.com/sitemap271.xml
2026-12-01
https://louisvillegop.com/sitemap136.xml
2026-12-01
https://louisvillegop.com/sitemap114.xml
2026-12-01
https://louisvillegop.com/sitemap239.xml
2026-12-01
https://louisvillegop.com/sitemap160.xml
2026-12-01
https://louisvillegop.com/sitemap255.xml
2026-12-01
https://louisvillegop.com/sitemap479.xml
2026-12-01
https://louisvillegop.com/sitemap447.xml
2026-12-01
https://louisvillegop.com/sitemap151.xml
2026-12-01
https://louisvillegop.com/sitemap605.xml
2026-12-01
https://louisvillegop.com/sitemap762.xml
2026-12-01
https://louisvillegop.com/sitemap367.xml
2026-12-01
https://louisvillegop.com/sitemap509.xml
2026-12-01
https://louisvillegop.com/sitemap194.xml
2026-12-01
https://louisvillegop.com/sitemap565.xml
2026-12-01
https://louisvillegop.com/sitemap199.xml
2026-12-01
https://louisvillegop.com/sitemap992.xml
2026-12-01
https://louisvillegop.com/sitemap810.xml
2026-12-01
https://louisvillegop.com/sitemap959.xml
2026-12-01
https://louisvillegop.com/sitemap133.xml
2026-12-01
https://louisvillegop.com/sitemap419.xml
2026-12-01
https://louisvillegop.com/sitemap636.xml
2026-12-01
https://louisvillegop.com/sitemap688.xml
2026-12-01
https://louisvillegop.com/sitemap629.xml
2026-12-01
https://louisvillegop.com/sitemap260.xml
2026-12-01
https://louisvillegop.com/sitemap777.xml
2026-12-01
https://louisvillegop.com/sitemap678.xml
2026-12-01
https://louisvillegop.com/sitemap948.xml
2026-12-01
https://louisvillegop.com/sitemap490.xml
2026-12-01
https://louisvillegop.com/sitemap9.xml
2026-12-01
https://louisvillegop.com/sitemap677.xml
2026-12-01
https://louisvillegop.com/sitemap166.xml
2026-12-01
https://louisvillegop.com/sitemap874.xml
2026-12-01
https://louisvillegop.com/sitemap527.xml
2026-12-01
https://louisvillegop.com/sitemap162.xml
2026-12-01
https://louisvillegop.com/sitemap562.xml
2026-12-01
https://louisvillegop.com/sitemap583.xml
2026-12-01
https://louisvillegop.com/sitemap287.xml
2026-12-01
https://louisvillegop.com/sitemap245.xml
2026-12-01
https://louisvillegop.com/sitemap32.xml
2026-12-01
https://louisvillegop.com/sitemap116.xml
2026-12-01
https://louisvillegop.com/sitemap336.xml
2026-12-01
https://louisvillegop.com/sitemap709.xml
2026-12-01
https://louisvillegop.com/sitemap179.xml
2026-12-01
https://louisvillegop.com/sitemap347.xml
2026-12-01
https://louisvillegop.com/sitemap225.xml
2026-12-01
https://louisvillegop.com/sitemap217.xml
2026-12-01
https://louisvillegop.com/sitemap353.xml
2026-12-01
https://louisvillegop.com/sitemap79.xml
2026-12-01
https://louisvillegop.com/sitemap671.xml
2026-12-01
https://louisvillegop.com/sitemap675.xml
2026-12-01
https://louisvillegop.com/sitemap35.xml
2026-12-01
https://louisvillegop.com/sitemap563.xml
2026-12-01
https://louisvillegop.com/sitemap578.xml
2026-12-01
https://louisvillegop.com/sitemap167.xml
2026-12-01
https://louisvillegop.com/sitemap357.xml
2026-12-01
https://louisvillegop.com/sitemap273.xml
2026-12-01
https://louisvillegop.com/sitemap945.xml
2026-12-01
https://louisvillegop.com/sitemap158.xml
2026-12-01
https://louisvillegop.com/sitemap244.xml
2026-12-01