%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/sitemap46.xml
2026-12-01
https://louisvillegop.com/sitemap672.xml
2026-12-01
https://louisvillegop.com/sitemap849.xml
2026-12-01
https://louisvillegop.com/sitemap24.xml
2026-12-01
https://louisvillegop.com/sitemap732.xml
2026-12-01
https://louisvillegop.com/sitemap686.xml
2026-12-01
https://louisvillegop.com/sitemap985.xml
2026-12-01
https://louisvillegop.com/sitemap604.xml
2026-12-01
https://louisvillegop.com/sitemap864.xml
2026-12-01
https://louisvillegop.com/sitemap166.xml
2026-12-01
https://louisvillegop.com/sitemap233.xml
2026-12-01
https://louisvillegop.com/sitemap498.xml
2026-12-01
https://louisvillegop.com/sitemap42.xml
2026-12-01
https://louisvillegop.com/sitemap603.xml
2026-12-01
https://louisvillegop.com/sitemap512.xml
2026-12-01
https://louisvillegop.com/sitemap824.xml
2026-12-01
https://louisvillegop.com/sitemap556.xml
2026-12-01
https://louisvillegop.com/sitemap500.xml
2026-12-01
https://louisvillegop.com/sitemap597.xml
2026-12-01
https://louisvillegop.com/sitemap871.xml
2026-12-01
https://louisvillegop.com/sitemap810.xml
2026-12-01
https://louisvillegop.com/sitemap904.xml
2026-12-01
https://louisvillegop.com/sitemap699.xml
2026-12-01
https://louisvillegop.com/sitemap245.xml
2026-12-01
https://louisvillegop.com/sitemap111.xml
2026-12-01
https://louisvillegop.com/sitemap224.xml
2026-12-01
https://louisvillegop.com/sitemap312.xml
2026-12-01
https://louisvillegop.com/sitemap390.xml
2026-12-01
https://louisvillegop.com/sitemap9.xml
2026-12-01
https://louisvillegop.com/sitemap285.xml
2026-12-01
https://louisvillegop.com/sitemap94.xml
2026-12-01
https://louisvillegop.com/sitemap893.xml
2026-12-01
https://louisvillegop.com/sitemap880.xml
2026-12-01
https://louisvillegop.com/sitemap997.xml
2026-12-01
https://louisvillegop.com/sitemap276.xml
2026-12-01
https://louisvillegop.com/sitemap37.xml
2026-12-01
https://louisvillegop.com/sitemap787.xml
2026-12-01
https://louisvillegop.com/sitemap4.xml
2026-12-01
https://louisvillegop.com/sitemap527.xml
2026-12-01
https://louisvillegop.com/sitemap883.xml
2026-12-01
https://louisvillegop.com/sitemap373.xml
2026-12-01
https://louisvillegop.com/sitemap952.xml
2026-12-01
https://louisvillegop.com/sitemap482.xml
2026-12-01
https://louisvillegop.com/sitemap211.xml
2026-12-01
https://louisvillegop.com/sitemap344.xml
2026-12-01
https://louisvillegop.com/sitemap737.xml
2026-12-01
https://louisvillegop.com/sitemap313.xml
2026-12-01
https://louisvillegop.com/sitemap340.xml
2026-12-01
https://louisvillegop.com/sitemap619.xml
2026-12-01
https://louisvillegop.com/sitemap908.xml
2026-12-01
https://louisvillegop.com/sitemap239.xml
2026-12-01
https://louisvillegop.com/sitemap651.xml
2026-12-01
https://louisvillegop.com/sitemap341.xml
2026-12-01
https://louisvillegop.com/sitemap778.xml
2026-12-01
https://louisvillegop.com/sitemap346.xml
2026-12-01
https://louisvillegop.com/sitemap60.xml
2026-12-01
https://louisvillegop.com/sitemap563.xml
2026-12-01
https://louisvillegop.com/sitemap648.xml
2026-12-01
https://louisvillegop.com/sitemap253.xml
2026-12-01
https://louisvillegop.com/sitemap774.xml
2026-12-01
https://louisvillegop.com/sitemap649.xml
2026-12-01
https://louisvillegop.com/sitemap645.xml
2026-12-01
https://louisvillegop.com/sitemap863.xml
2026-12-01
https://louisvillegop.com/sitemap274.xml
2026-12-01
https://louisvillegop.com/sitemap961.xml
2026-12-01
https://louisvillegop.com/sitemap206.xml
2026-12-01
https://louisvillegop.com/sitemap272.xml
2026-12-01
https://louisvillegop.com/sitemap643.xml
2026-12-01
https://louisvillegop.com/sitemap309.xml
2026-12-01
https://louisvillegop.com/sitemap728.xml
2026-12-01