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 to WP 6.3 - Navigation fallbacks from 4648 #4713

Closed

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Jun 27, 2023

Adds files relating to Navigation fallbacks for the block editor.

This PR brings #4648 over in its entirety but with updated fixtures.

Props @getdave

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


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.

@ramonjd ramonjd changed the title Backport/navigation fallbacks from 4648 Backport to WP 6.3 - Navigation fallbacks from 4648 Jun 27, 2023

$navigation_post = new WP_Query( $parsed_args );

if ( count( $navigation_post->posts ) > 0 ) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if ( count( $navigation_post->posts ) > 0 ) {
if ( $navigation_post->found_posts > 0 ) {

Instead of count use found_posts

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @mukeshpanchal27

Makes sense to me.

Looks like this has been committed. I'll do a follow up after Beta 1.

Copy link
Member Author

Choose a reason for hiding this comment

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

Core class: #4733
Updating Gutenberg: WordPress/gutenberg#51999

Copy link
Member Author

Choose a reason for hiding this comment

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

Might have to follow up another day actually

$navigation_post->found_posts returns 0 and I haven't got time to dig around. Sorry!

@tellthemachines
Copy link
Contributor

committed in r56052 / 3d551af

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