Make WordPress Core

Changeset 47830


Ignore:
Timestamp:
05/19/2020 11:28:10 PM (6 years ago)
Author:
whyisjake
Message:

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.

This brings the changes in [47799] to the 5.4 branch.

Props joyously, donmhico.
Fixes #48803.

Location:
branches/5.4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

  • branches/5.4/src/wp-content/themes/twentytwenty/inc/template-tags.php

    r47122 r47830  
    339339
    340340                                // Author.
    341                                 if ( in_array( 'author', $post_meta, true ) ) {
     341                                if ( post_type_supports( get_post_type( $post_id ), 'author' ) && in_array( 'author', $post_meta, true ) ) {
    342342
    343343                                        $has_meta = true;
  • branches/5.4/src/wp-content/themes/twentytwenty/template-parts/content-cover.php

    r47122 r47830  
    147147                twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
    148148
    149                 if ( is_single() ) {
     149                if ( post_type_supports( get_post_type( get_the_ID() ), 'author' ) && is_single() ) {
    150150
    151151                        get_template_part( 'template-parts/entry-author-bio' );
  • branches/5.4/src/wp-content/themes/twentytwenty/template-parts/content.php

    r46827 r47830  
    5858                twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
    5959
    60                 if ( is_single() ) {
     60                if ( post_type_supports( get_post_type( get_the_ID() ), 'author' ) && is_single() ) {
    6161
    6262                        get_template_part( 'template-parts/entry-author-bio' );
Note: See TracChangeset for help on using the changeset viewer.