Bundled Themes: Twenty Twenty custom post types that don't support authors, shows author box.

This fixes the issue where custom post types will show an author box, even if they don't support authors.

Props joyously, donmhico.
Fixes #48803.

git-svn-id: https://develop.svn.wordpress.org/trunk@47799 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ian Belanger 2020-05-14 17:15:41 +00:00
parent 25133cf3f1
commit 7d94081279
3 changed files with 3 additions and 3 deletions

View File

@ -338,7 +338,7 @@ function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )
do_action( 'twentytwenty_start_of_post_meta_list', $post_id, $post_meta, $location ); do_action( 'twentytwenty_start_of_post_meta_list', $post_id, $post_meta, $location );
// Author. // Author.
if ( in_array( 'author', $post_meta, true ) ) { if ( post_type_supports( get_post_type( $post_id ), 'author' ) && in_array( 'author', $post_meta, true ) ) {
$has_meta = true; $has_meta = true;
?> ?>

View File

@ -146,7 +146,7 @@
// Single bottom post meta. // Single bottom post meta.
twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' ); twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
if ( is_single() ) { if ( post_type_supports( get_post_type( get_the_ID() ), 'author' ) && is_single() ) {
get_template_part( 'template-parts/entry-author-bio' ); get_template_part( 'template-parts/entry-author-bio' );

View File

@ -57,7 +57,7 @@
// Single bottom post meta. // Single bottom post meta.
twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' ); twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
if ( is_single() ) { if ( post_type_supports( get_post_type( get_the_ID() ), 'author' ) && is_single() ) {
get_template_part( 'template-parts/entry-author-bio' ); get_template_part( 'template-parts/entry-author-bio' );