<?php
/**
 * Template part for displaying author Meta
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Glides
 */
$glides_author_description = get_the_author_meta( 'description' );
$glides_author_id          = get_the_author_meta( 'ID' );
$glides_current_user_id    = is_user_logged_in() ? wp_get_current_user()->ID : false;
?>
<article class="blog-post author-details">
	<div class="section-header">
		<h2>
			<?php esc_html_e('About the Author','glides'); ?>
		</h2>
	</div>
	<div class="media">
		<div class="auth-mata">
			<?php echo get_avatar( get_the_author_meta('ID'), 200); ?>	
		</div>
		<div class="media-body author-meta-det">
			<h4>
				<a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))) ?>" title="<?php echo esc_url(get_avatar_url(get_the_author_meta( 'name' ))) ?>" class="author">
					<span class="primary-color"><?php esc_html(the_author()); ?></span></span>
				</a>
			</h4>
			<p>
			<?php 
				if ( '' === $glides_author_description ) {
					if ( $glides_current_user_id && $glides_author_id === $glides_current_user_id ) {

						// Translators: %1$s: <a> tag. %2$s: </a>.
						printf( wp_kses_post( __( 'You haven&rsquo;t entered your Biographical Information yet. %1$sEdit your Profile%2$s now.', 'glides' ) ), '<a href="' . esc_url( get_edit_user_link( $glides_current_user_id ) ) . '">', '</a>' );
					}
				}else{
					echo wp_kses_post( $glides_author_description ); 
				}
			?>
			</p>
			<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) ); ?>" class="main-btn"><?php esc_html_e('View All Post','glides'); ?></a>
		</div>
	</div>
</article>