'author_name', 'echo' => false ) ) . '>'. $name . '';
$heading = __( 'About', 'avia_framework' ) . ' ' . $name;
$default_heading = 'h3';
$args = array(
'heading' => $default_heading,
'extra_class' => ''
);
/**
* @since 4.5.5
* @return array
*/
$args = apply_filters( 'avf_customize_heading_settings', $args, 'loop_default_author', array() );
$heading1 = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading;
$css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : '';
// Count posts for all defined post types
$default_args = array( 'post_types' => array('post') );
$atts = apply_filters( 'avf_author_loop_args', $default_args, 'author' );
$cnt_posts = 0;
$post_type_counts = array();
if( ! empty( $atts['post_types'] ) && is_array( $atts['post_types'] ) ) {
foreach( $atts['post_types'] as $post_type ) {
$count = count_user_posts( $author_id, $post_type );
if( $count > 0 ) {
$cnt_posts += $count;
// Get post type label
$post_type_obj = get_post_type_object( $post_type );
$post_type_label = $post_type_obj ? $post_type_obj->labels->name : $post_type;
$post_type_counts[] = $count . ' ' . $post_type_label;
}
}
} else {
// Fallback: count only posts
$cnt_posts = count_user_posts( $author_id );
}
// Build entry count text
$entry_text = '';
if( $cnt_posts > 0 ) {
$breakdown = ! empty( $post_type_counts ) ? ' (' . implode( ', ', $post_type_counts ) . ')' : '';
// Use existing Enfold translation string - breakdown at the end
$entry_text = '
' . sprintf( __( 'But we are proud to say that %s contributed %s entries already.', 'avia_framework' ), $name, $cnt_posts ) . '
' . $breakdown;
}
if( empty( $description ) )
{
$description = __( 'This author has not written his bio yet.', 'avia_framework' );
$description .= $entry_text;
if( current_user_can( 'edit_users' ) || get_current_user_id() == $author_id )
{
$description .= "
" . __( 'Edit the profile description here.', 'avia_framework' ) . '';
}
}
else
{
// Bio exists - append entry count
$description .= $entry_text;
}
/**
* Filter final output of author description or skip completly
*
* @since 4.7.5.1
* @param string $description
* @param string $description_ori
* @param int $author_id
* @return string|false false to skip output completely
*/
$description = apply_filters( 'avf_author_description_loop_about', $description, $description_ori, $author_id );
if( false === $description )
{
return;
}
echo ' 'author', 'echo' => false ) ) . '>';
echo "{$gravatar}";
echo "";
echo "<{$heading1} class='author-title {$css}'>{$heading}{$heading1}>";
echo "
'description', 'echo' => false ) ) . '>' . wpautop( $description ) . '
';
echo '';
echo '
';
echo '';