Ticket #37516: combined-37516.diff
File combined-37516.diff, 5.9 KB (added by , 6 years ago) |
---|
-
src/wp-content/themes/twentyseventeen/functions.php
55 55 56 56 add_image_size( 'twentyseventeen-thumbnail-avatar', 100, 100, true ); 57 57 58 add_theme_support( 'custom-title-tagline' ); 59 58 60 // Set the default content width. 59 61 $GLOBALS['content_width'] = 525; 60 62 -
src/wp-content/themes/twentyseventeen/inc/customizer.php
19 19 20 20 $wp_customize->selective_refresh->add_partial( 'blogname', array( 21 21 'selector' => '.site-title a', 22 'settings' => array( 'blogname', 'header_display_title' ), 22 23 'render_callback' => 'twentyseventeen_customize_partial_blogname', 23 24 ) ); 24 25 $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 25 26 'selector' => '.site-description', 27 'settings' => array( 'blogdescription', 'header_display_tagline' ), 26 28 'render_callback' => 'twentyseventeen_customize_partial_blogdescription', 27 29 ) ); 28 30 … … 163 165 * @return void 164 166 */ 165 167 function twentyseventeen_customize_partial_blogname() { 166 bloginfo( 'name' ); 168 if ( get_option( 'header_display_title' ) ) { 169 bloginfo( 'name' ); 170 } 167 171 } 168 172 169 173 /** … … 175 179 * @return void 176 180 */ 177 181 function twentyseventeen_customize_partial_blogdescription() { 178 bloginfo( 'description' ); 182 if ( get_option( 'header_display_tagline' ) ) { 183 bloginfo( 'description' ); 184 } 179 185 } 180 186 181 187 /** -
src/wp-content/themes/twentyseventeen/template-parts/header/site-branding.php
16 16 17 17 <div class="site-branding-text"> 18 18 <?php if ( is_front_page() ) : ?> 19 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> 19 <?php if ( get_option( 'header_display_title' ) ) : ?> 20 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> 21 <?php endif; ?> 20 22 <?php else : ?> 21 <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> 23 <?php if ( get_option( 'header_display_title' ) ) : ?> 24 <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> 25 <?php endif; ?> 22 26 <?php endif; ?> 23 27 24 28 <?php … … 26 30 27 31 if ( $description || is_customize_preview() ) : 28 32 ?> 29 <p class="site-description"><?php echo $description; ?></p> 33 <?php if ( get_option( 'header_display_tagline' ) ) : ?> 34 <p class="site-description"><?php echo $description; ?></p> 35 <?php endif; ?> 30 36 <?php endif; ?> 31 37 </div><!-- .site-branding-text --> 32 38 -
src/wp-includes/class-wp-customize-manager.php
4455 4455 'section' => 'title_tagline', 4456 4456 ) ); 4457 4457 4458 // Theme feature for enabling and disabling the site title 4459 if ( current_theme_supports( 'custom-title-tagline', 'display-title' ) ) { 4460 $this->add_setting( 'header_display_title', array( 4461 'default' => get_option( 'header_display_title' ) || get_option( 'blogname' ), 4462 'type' => 'option', 4463 'capability' => 'manage_options', 4464 'transport' => 'postMessage', 4465 'sanitize_callback' => 'absint', 4466 ) ); 4467 4468 $this->add_control( 'header_display_title', array( 4469 'label' => __( 'Display Site Title' ), 4470 'section' => 'title_tagline', 4471 'settings' => 'header_display_title', 4472 'type' => 'checkbox', 4473 ) ); 4474 } 4475 4476 // Theme feature for enabling and disabling the site tagline 4477 if ( current_theme_supports( 'custom-title-tagline', 'display-tagline' ) ) { 4478 $this->add_setting( 'header_display_tagline', array( 4479 'default' => get_option( 'header_display_tagline' ) || get_option( 'blogdescrption' ), 4480 'type' => 'option', 4481 'capability' => 'manage_options', 4482 'transport' => 'postMessage', 4483 'sanitize_callback' => 'absint', 4484 ) ); 4485 4486 $this->add_control( 'header_display_tagline', array( 4487 'label' => __( 'Display Site Tagline' ), 4488 'section' => 'title_tagline', 4489 'settings' => 'header_display_tagline', 4490 'type' => 'checkbox', 4491 ) ); 4492 } 4493 4458 4494 // Add a setting to hide header text if the theme doesn't support custom headers. 4459 if ( ! current_theme_supports( 'custom-header', 'header-text' ) ) {4495 if ( ! current_theme_supports( 'custom-header', 'header-text' ) && ! current_theme_supports( 'custom-title-tagline' ) ) { 4460 4496 $this->add_setting( 'header_text', array( 4461 4497 'theme_supports' => array( 'custom-logo', 'header-text' ), 4462 4498 'default' => 1, -
src/wp-includes/theme.php
2419 2419 2420 2420 return false; 2421 2421 } 2422 2423 break; 2424 2425 case 'custom-title-tagline': 2426 if ( ! is_array( $args ) ) { 2427 $args = array( 2428 0 => array(), 2429 ); 2430 } 2431 2432 $defaults = array( 2433 'display-title' => true, 2434 'display-tagline' => true, 2435 ); 2436 2437 $args[0] = wp_parse_args( array_intersect_key( $args[0], $defaults ), $defaults ); 2438 2439 break; 2440 2422 2441 } 2423 2442 2424 2443 $_wp_theme_features[ $feature ] = $args;