'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 ] ); if ( ! empty( $args['class'] ) ) { $args['class'] = ' ' . $args['class']; } 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 ) { ?>
  • '; echo ''; echo __( 'In ', 'blocksy' ); echo ''; echo ''; echo blocksy_get_categories_list( ' ' ); echo ''; echo ''; } else { echo '
  • '; echo blocksy_get_categories_list( '
  • ' ); echo '
  • '; } } if ( $post_meta_descriptor['tags'] && blocksy_get_categories_list( '', false ) ) { // echo ''; // echo __( 'Tags ', 'blocksy ); // echo ''; echo '
  • '; echo blocksy_get_categories_list( '
  • ', false ); echo '
  • '; } ?>
    >