Skip to content

Backport: opt out for Navigation fallback creation - #4813

Closed
getdave wants to merge 6 commits into
WordPress:trunkfrom
getdave:update/opt-out-for-nav-fallbacks
Closed

getdave wants to merge 6 commits into
WordPress:trunkfrom
getdave:update/opt-out-for-nav-fallbacks

Conversation

@getdave

@getdave getdave commented Jul 7, 2023

Copy link
Copy Markdown
Contributor

Updates original backport from https://core.trac.wordpress.org/ticket/58557 to also allow developers to opt out of the auto-creation of the fallback.

Why? Because if we automatically create something (even if it requires interaction with the WP site or editor) we should allow folks to opt out of that.

Trac ticket: https://core.trac.wordpress.org/ticket/58750


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

$fallback = static::get_most_recently_published_navigation();

if ( $fallback ) {
if ( $fallback || ! $should_create_fallback ) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we're not opting out of fetching a fallback, it's opting out of creating one either from:

  • converting a classic menu
  • creating a new block based menu

Co-authored-by: Jonny Harris <spacedmonkey@users.noreply.github.com>

@ramonjd ramonjd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to me.
A couple of nitpicks.

getdave and others added 2 commits July 10, 2023 11:58
Co-authored-by: Ramon <ramonjd@users.noreply.github.com>
Co-authored-by: Ramon <ramonjd@users.noreply.github.com>
@tellthemachines

Copy link
Copy Markdown
Contributor

Committed in r56202 / a02886a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

4 participants