WordPress.org

Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 10 months ago

#39104 closed defect (bug) (fixed)

Customize: starter content home menu item needs to be a link, not a page

Reported by: celloexpressions Owned by: westonruter
Milestone: 4.7.1 Priority: normal
Severity: major Version: 4.7
Component: Customize Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

Core menus use a custom link item for "home" rather than associating home with a static front page, when present. However, starter content provides a page_home item that insets the "home" page as an item in the starter menu.

Menus use a link for "home" because the page item will not always actually link home if the user changes the static front page option to be a different page or show the latest posts. This also means that core does not provide a starter-content menu item for "home" for themes that default to showing latest posts on front. For these reasons, the page_home menu item in starter content should be replaced with link_home to avoid theme developers accidentally introducing this usability trap.

Presuming that this is delayed to 4.7.1, we probably shouldn't remove the page_home item entirely. Instead we can deprecate it and change it to be the link-type menu item that it should be. We'd also add a link_home item that has a title of "Home" and a url of the site url. Because page_home becomes an unfortunate deprecated item existing only for back compat and with an inaccurate name, Twenty Seventeen would need to be updated alongside 4.7.1 as it currently contains the only canonical example implementation of starter content and is likely to be directly copied.

Note that until this is changed, all users creating a new site with core starter content will end up with easily-broken "home" links in their menus.

Attachments (1)

39104.diff (1.0 KB) - added by celloexpressions 11 months ago.
Use a link for the home menu item in starter content to align with core menus and avoid usability issues. Also updates Twenty Seventeen.

Download all attachments as: .zip

Change History (12)

@celloexpressions
11 months ago

Use a link for the home menu item in starter content to align with core menus and avoid usability issues. Also updates Twenty Seventeen.

#1 @celloexpressions
11 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from 4.7.1 to 4.7

Moving to 4.7 for a final review/decision given the simplicity of the patch despite the timing. This will be more difficult to fix if we need to provide back-compat in 4.7.1 and since Twenty Seventeen would also need a tiny update. Users would also get stuck with bad home links in their menus if we wait.

#2 @helen
11 months ago

  • Milestone changed from 4.7 to 4.7.1

The practical implications of this are low enough that I am not concerned about it for 4.7. Theme review queue is quite long, switching themes to something not from .org is very unlikely for a fresh site, and people are far more likely to edit the home page than actually change their static front page setting. Obviously we should look at this more and fix it, but this is not the kind of thing you break a freeze and delay a release for, which we were in at the point that you milestoned this.

#3 @celloexpressions
11 months ago

Note that it is broken in Twenty Seventeen. Users setting up fresh sites will have broken home links if they switch to latest posts on the front page, even if they decide to switch to a different theme later (since menus stay cross-theme). Hopefully they'll figure out to remove and re-add the link in menus.

It sounds like we're okay with breaking back-compat between 4.7 and 4.7.1 and going with 39104.diff based on the above reasons, though.

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


11 months ago

This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.


11 months ago

#6 @sirbrillig
11 months ago

  • Keywords commit added

#7 @westonruter
11 months ago

  • Owner set to westonruter
  • Status changed from new to accepted

#8 @westonruter
11 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 39561:

Customize: Deprecate page_home nav menu item starter content in favor of home_link; replace usage in Twenty Seventeen.

Props celloexpressions, westonruter.
Amends [38991].
See #38615, #38114.
Fixes #39104.

#9 @westonruter
11 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.7.1

#10 @dd32
11 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 39575:

Customize: Deprecate page_home nav menu item starter content in favor of home_link; replace usage in Twenty Seventeen.

Props celloexpressions, westonruter.
See #38615, #38114, [38991].
Merges [39561] to the 4.7 branch.
Fixes #39104.

#11 @SergeyBiryukov
10 months ago

In 39751:

Customize: Correct a comment in get_theme_starter_content() added in [39561].

The item name is link_home, not home_link.

See #39104.

Note: See TracTickets for help on using tickets.