'yes' | 'no' | true | false, * 'comments' => 'yes' | 'no' | true | false, * 'post_date' => 'yes' | 'no' | true | false, * 'categories' => 'yes' | 'no' | true | false, * ) */ function blocksy_post_meta( $post_meta_descriptor = [], $args = [] ) { $post_meta_descriptor = array_merge( [ 'author' => false, 'comments' => false, 'post_date' => false, 'categories' => false, 'author_avatar' => false, 'tags' => false, ], $post_meta_descriptor ); $args = wp_parse_args( $args, [ 'class' => '', 'avatar_size' => '35px', 'labels' => true, 'category_style' => 'simple', 'plain' => false, 'meta_type' => 'simple', 'force_icons' => false, 'date_format' => 'M j, Y' ] ); if ( ! empty( $args['class'] ) ) { $args['class'] = ' ' . $args['class']; } if ($args['meta_type'] === 'icons') { $args['labels'] = false; } if ($args['meta_type'] === 'icons') { $args['category_style'] = 'simple'; } global $post; if ( get_post_type( $post ) === 'page' ) { $post_meta_descriptor['comments'] = false; $post_meta_descriptor['categories'] = false; $post_meta_descriptor['tags'] = false; } if ( ! in_array( true, array_values( $post_meta_descriptor ), true ) ) { return ''; } // Author ID global $post; $user_id = $post->post_author; $avatar = ''; if ( $post_meta_descriptor['author_avatar'] ) { $avatar = ' has-avatar'; } ob_start(); ?>
  • > >
  • > >
  • 0 ) { ?>
  • '; if ($args['meta_type'] === 'icons' || $args['force_icons']) { echo ''; echo ''; echo ''; } if ($args['labels']) { echo ''; echo esc_html(__( 'In ', 'blocksy' )); echo ''; } echo ''; echo wp_kses_post(blocksy_get_categories_list( ' ' )); echo ''; echo ''; } else { echo '
  • '; echo wp_kses_post(blocksy_get_categories_list( '
  • ' )); echo '
  • '; } } if ( $post_meta_descriptor['tags'] && blocksy_get_categories_list( '', false ) ) { echo '
  • '; echo wp_kses_post(blocksy_get_categories_list( '
  • ', false )); echo '
  • '; } ?>
    data-type=""> intval($args['avatar_size']) * 2 ] ), [ 'tag_name' => 'a', 'html_atts' => [ 'class' => 'avatar-container', 'href' => get_author_posts_url(get_the_author_meta('ID')), ], 'img_atts' => [ 'width' => intval($args['avatar_size']), 'height' => intval($args['avatar_size']) ], ] ); } ?>