Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: opt out for Navigation fallback creation #4813

Closed

Conversation

getdave
Copy link

@getdave getdave commented Jul 7, 2023

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
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 <[email protected]>
Copy link
Member

@ramonjd ramonjd left a comment

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
@tellthemachines
Copy link
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