Skip to content

Commit

Permalink
Bundled Themes: Adds Customizer option to show or hide author bio Twe…
Browse files Browse the repository at this point in the history
…nty 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46813 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
ianbelanger79 committed Dec 4, 2019
1 parent 8b08d64 commit 46cffd8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Expand Up @@ -205,7 +205,7 @@ public static function register( $wp_customize ) {
)
);

/* Enable Header Search --------- */
/* Enable Header Search ----------------------------------------------- */

$wp_customize->add_setting(
'enable_header_search',
Expand All @@ -226,6 +226,27 @@ public static function register( $wp_customize ) {
)
);

/* Show author bio ---------------------------------------------------- */

$wp_customize->add_setting(
'show_author_bio',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
)
);

$wp_customize->add_control(
'show_author_bio',
array(
'type' => 'checkbox',
'section' => 'options',
'priority' => 10,
'label' => __( 'Show author bio', 'twentytwenty' ),
)
);

/* Display full content or excerpts on the blog and archives --------- */

$wp_customize->add_setting(
Expand Down
Expand Up @@ -7,7 +7,7 @@
* @since 1.0.0
*/

if ( (bool) get_the_author_meta( 'description' ) ) : ?>
if ( (bool) get_the_author_meta( 'description' ) && (bool) get_theme_mod( 'show_author_bio', true ) ) : ?>
<div class="author-bio">
<div class="author-title-wrapper">
<div class="author-avatar vcard">
Expand Down

0 comments on commit 46cffd8

Please sign in to comment.