WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#30358 closed defect (bug) (fixed)

Twenty Fifteen: Improve site description handling within the Customizer.

Reported by: philiparthurmoore Owned by: iandstewart
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

Right now, this is the code that’s used to output site descriptions in Twenty Fifteen:

<?php
					$description = get_bloginfo( 'description', 'display' );
					if ( ! empty( $description ) ) : ?>
						<p class="site-description"><?php echo esc_html( $description ); ?></p>
					<?php endif;

That’s nice because junky markup isn’t added into the front-end when a blog description is empty. This is problematic, though, inside of the Customizer when using postMessage.

  1. Make your site description blank.
  2. Reload your Customizer.
  3. Try to add a description into the site.
  4. Nothing is reflected inside of the customizer.

Because no markup is present for postMessage when a site description is empty we either need to a) revert get_setting( 'blogdescription' )->transport to refresh by removing that line altogether (since refresh is the default) or b) add some logic into header.php that outputs markup when we’re inside of the customizer and a site title is empty.

Attachments (3)

30358-choice-a.diff (1.3 KB) - added by philiparthurmoore 6 years ago.
30358-choice-b-trim-whitespace.diff (1.0 KB) - added by philiparthurmoore 6 years ago.
30358-choice-b.diff (562 bytes) - added by philiparthurmoore 6 years ago.

Download all attachments as: .zip

Change History (8)

#1 @celloexpressions
6 years ago

Let's do the second option - just change the conditional to if ( ! empty( $description ) || is_customize_preview() ) and we should be good to go.

#2 @philiparthurmoore
6 years ago

Cool. Patch incoming.

This ticket was mentioned in Slack in #core-themes by iandstewart. View the logs.


6 years ago

#4 @iandstewart
6 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 4.1

#5 @iandstewart
6 years ago

  • Owner set to iandstewart
  • Resolution set to fixed
  • Status changed from new to closed

In 30391:

Twenty Fifteen: Check if we're in the customizer before we avoid outputting HTML for an empty tagline. Avoids an issue with a not-updating customizer preview of the tagline if you're going in with an empty tagline.

Props philiparthurmoore, celloexpressions, fixes #30358.

Note: See TracTickets for help on using tickets.