Make WordPress Core

Changeset 46813


Ignore:
Timestamp:
12/04/2019 03:57:54 PM (4 years ago)
Author:
ianbelanger
Message:

Bundled Themes: Adds Customizer option to show or hide author bio Twenty Twenty.

This adds an option to the Customizer that allows you to turn the author bio on or off, sitewide.

Props williampatton, nielslange acosmin, dlh.
Fixes #48550.

Location:
trunk/src/wp-content/themes/twentytwenty
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php

    r46613 r46813  
    206206            );
    207207
    208             /* Enable Header Search --------- */
     208            /* Enable Header Search ----------------------------------------------- */
    209209
    210210            $wp_customize->add_setting(
     
    224224                    'priority' => 10,
    225225                    'label'    => __( 'Show search in header', 'twentytwenty' ),
     226                )
     227            );
     228
     229            /* Show author bio ---------------------------------------------------- */
     230
     231            $wp_customize->add_setting(
     232                'show_author_bio',
     233                array(
     234                    'capability'        => 'edit_theme_options',
     235                    'default'           => true,
     236                    'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
     237                )
     238            );
     239
     240            $wp_customize->add_control(
     241                'show_author_bio',
     242                array(
     243                    'type'     => 'checkbox',
     244                    'section'  => 'options',
     245                    'priority' => 10,
     246                    'label'    => __( 'Show author bio', 'twentytwenty' ),
    226247                )
    227248            );
  • trunk/src/wp-content/themes/twentytwenty/template-parts/entry-author-bio.php

    r46613 r46813  
    88 */
    99
    10 if ( (bool) get_the_author_meta( 'description' ) ) : ?>
     10if ( (bool) get_the_author_meta( 'description' ) && (bool) get_theme_mod( 'show_author_bio', true ) ) : ?>
    1111<div class="author-bio">
    1212    <div class="author-title-wrapper">
Note: See TracChangeset for help on using the changeset viewer.