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

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

Props williampatton, nielslange, acosmin, dlh, ianbelanger.
Merges [46813] to the 5.3 branch.
Fixes #48550.
Built from https://develop.svn.wordpress.org/branches/5.3@46848


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-12-09 14:41:04 +00:00
parent 7e5d62f195
commit 06ebac2233
3 changed files with 24 additions and 3 deletions

View File

@ -205,7 +205,7 @@ if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
)
);
/* Enable Header Search --------- */
/* Enable Header Search ----------------------------------------------- */
$wp_customize->add_setting(
'enable_header_search',
@ -226,6 +226,27 @@ if ( ! class_exists( 'TwentyTwenty_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(

View File

@ -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">

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3.1-alpha-46847';
$wp_version = '5.3.1-alpha-46848';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.