" : ''; ?>
". get_the_category_list( ' ', '', $post->ID ) ."" : ''; ?>
$post->post_title" : $post->post_title; ?>
post_author );
$authorName = get_the_author_meta( 'display_name', $post->post_author );
$iconEl = $metaAuthorIcon ? "
" : "";
$authorEl = false === $isMetaAuthorLink ? "$authorName" : "$authorName";
$metaAuthorEl = "$iconEl $authorEl";
ob_start();
echo wp_kses_post( $metaAuthorEl );
return ob_get_clean();
} else {
return '';
}
} // Meta Author
static function metaDate( $attributes, $post ) {
extract( $attributes );
$metaDateFormat = $metaDateFormat ?? 'M j, Y';
if ( $isMetaDate ) {
$date = get_the_date( $metaDateFormat, $post->ID );
$iconEl = $metaDateIcon ? "
" : "";
$metaDateEl = "$iconEl $date";
ob_start();
echo wp_kses_post( $metaDateEl );
return ob_get_clean();
} else {
return '';
}
} // Meta Date
static function metaCategories( $attributes, $post ) {
extract( $attributes );
if ( $isMetaCategory && 'content' === $metaCategoryIn ) {
$categoryList = get_the_category_list( esc_html__( ', ' ), '', $post->ID );
$iconEl = $metaCategoryIcon ? "
" : "";
$metaCategoryEl = "$iconEl $categoryList";
ob_start();
echo wp_kses_post( $metaCategoryEl );
return ob_get_clean();
} else {
return '';
}
} // Meta Categories
static function metaReadTime( $attributes, $post ) {
extract( $attributes );
if ( $isMetaReadTime ) {
$contentWords = count( preg_split( '/[\s]+/', strip_tags( $post->post_content ) ) );
$readTimeMin = floor( $contentWords / 200 );
$readTimeSec = floor( $contentWords % 200 / ( 200 / 60 ) );
$readTime = $isMetaReadTimeSec ? $readTimeMin .':'. $readTimeSec : $readTimeMin;
$iconEl = $metaReadTimeIcon ? "
" : "";
$readTimeContent = $readTime .' '. $metaReadTimeLabel;
$metaReadTimeEl = "$iconEl $readTimeContent";
ob_start();
echo wp_kses_post( $metaReadTimeEl );
return ob_get_clean();
} else {
return '';
}
} // Meta Categories
static function metaComment( $attributes, $post ) {
extract( $attributes );
if ( $isMetaComment ) {
$commentUrl = esc_url( get_permalink( $post ) ) . '/#comments';
$commentCount = wp_count_comments( $post->ID )->total_comments;
$iconEl = $metaCommentIcon ? "
" : "";
$metaCommentEl = "$iconEl $commentCount";
ob_start();
echo wp_kses_post( $metaCommentEl );
return ob_get_clean();
} else {
return '';
}
} // Meta Comment
static function excerpt( $attributes, $post ) {
extract( $attributes );
$excerpt = $post->post_excerpt;
$content = preg_replace('/(<([^>]+)>)/', '', $post->post_content);
$excerptContent = ( !$isExcerptFromContent && $excerpt ) ? $excerpt : $content;
if ( $isExcerpt ) {
ob_start(); ?>