WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#27630 closed defect (bug) (fixed)

Static front page opt-in via customizer

Reported by: Clorith Owned by: SergeyBiryukov
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.8.1
Component: Administration Keywords: has-patch commit
Focuses: ui, administration Cc:
PR Number:

Description

The static front page option is hidden under Settings > Reading if there are no pages available, but in the Customize screen this shows labels with no select boxes, giving the impression of something being broken.

Attached patch replicates the behavior of the settings page by only showing the static front page group if there exists any pages by doing a if ( get_pages() ) check

Attachments (1)

27630.patch (3.5 KB) - added by Clorith 6 years ago.

Download all attachments as: .zip

Change History (12)

@Clorith
6 years ago

#1 follow-up: @Clorith
6 years ago

  • Keywords has-patch added

#3 @Clorith
6 years ago

  • Summary changed from Static front page opt-in via widgets to Static front page opt-in via customizer

#4 in reply to: ↑ 1 ; follow-up: @ElectricFeet
5 years ago

Replying to Clorith:
Could you tell me if this code resolves the inconsistency that I reported here: http://wordpress.org/support/topic/inconsistency-in-how-wordpress-saves-front-page-options?replies=1 ?

I see that it substitutes the Customizer code with a lot of the Settings > Reading code, so it should fix that problem, but I'm a PHP newbie so cannot be sure.

If it doesn't, I'll open a new ticket for that inconsistency.

#5 in reply to: ↑ 4 ; follow-up: @Clorith
5 years ago

Replying to ElectricFeet:

Replying to Clorith:
Could you tell me if this code resolves the inconsistency that I reported here: http://wordpress.org/support/topic/inconsistency-in-how-wordpress-saves-front-page-options?replies=1 ?

I see that it substitutes the Customizer code with a lot of the Settings > Reading code, so it should fix that problem, but I'm a PHP newbie so cannot be sure.

If it doesn't, I'll open a new ticket for that inconsistency.

Sorry for the delayed response.

My patch actually removes the option from the customize screen altogether if there are no pages on your site, so it would be a different case than the one you've discovered.

#6 @danielbachhuber
5 years ago

  • Milestone changed from Awaiting Review to Future Release

Not to hijack the thread, but I thought it might be better than creating a second ticket. Customizer says:

Your theme supports a static front page.

What if remove_theme_support( 'static-front-page' ) removed support entirely (e.g. removed the option, didn't register the Customizer Section, etc.) ?

#7 @Clorith
5 years ago

Not a bad idea, but we'd still need the check in place as some themes support both and we'd want to avoid the "broken" look when they do support a static page.

#8 in reply to: ↑ 5 @ElectricFeet
5 years ago

Replying to Clorith:

Replying to ElectricFeet:

Replying to Clorith:
Could you tell me if this code resolves the inconsistency that I reported here: http://wordpress.org/support/topic/inconsistency-in-how-wordpress-saves-front-page-options?replies=1 ?

I see that it substitutes the Customizer code with a lot of the Settings > Reading code, so it should fix that problem, but I'm a PHP newbie so cannot be sure.

If it doesn't, I'll open a new ticket for that inconsistency.

Sorry for the delayed response.

My patch actually removes the option from the customize screen altogether if there are no pages on your site, so it would be a different case than the one you've discovered.

Apologies for the delay in responding. Thanks for the reply Clorith.

I think I need to open another ticket...

#9 @celloexpressions
5 years ago

  • Keywords commit added
  • Milestone changed from Future Release to 4.2

27630.patch fixes this ticket and still applies cleanly.

#10 @SergeyBiryukov
5 years ago

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

In 31234:

Customizer: Replicate behavior from options-reading.php and hide front page options if there are no pages.

props Clorith.
fixes #27630.

This ticket was mentioned in Slack in #core by drew. View the logs.


3 years ago

Note: See TracTickets for help on using tickets.