HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: afleverb (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/drakkar_site/wp-content/plugins/otter-blocks/inc/render/class-about-author-block.php
<?php
/**
 * About_Author_Block
 *
 * @package ThemeIsle\GutenbergBlocks\Render
 */

namespace ThemeIsle\GutenbergBlocks\Render;

/**
 * Class About_Author_Block
 */
class About_Author_Block {

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @param array $attributes Block attrs.
	 * @return mixed|string
	 */
	public function render( $attributes ) {
		$img_markup = sprintf(
			'<a href="%1$s"><img src="%2$s" class="author-image" /></a>',
			esc_url( get_author_posts_url( intval( get_the_author_meta( 'ID' ) ) ) ),
			esc_attr( get_avatar_url( get_the_author_meta( 'ID' ), array( 'size' => 130 ) ) )
		);

		$title_markup = sprintf(
			'<h4>%1$s</h4>',
			esc_html( get_the_author_meta( 'display_name' ) )
		);

		$content_markup = '';
		if ( ! empty( get_the_author_meta( 'description' ) ) ) {
			$content_markup = sprintf(
				'<p>%1$s</p>',
				esc_html( wp_strip_all_tags( get_the_author_meta( 'description' ) ) )
			);
		}

		return sprintf(
			'<section %1$s><div class="o-author-image">%2$s</div><div class="o-author-data">%3$s%4$s</div></section>',
			get_block_wrapper_attributes(),
			$img_markup,
			$title_markup,
			$content_markup
		);
	}
}