mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Editor: opt out of Navigation fallback.
Allows developers to opt out of the auto-creation of the Navigation fallback through a filter. Props get_dave, spacedmonkey, ramonopoly. Fixes #58750. git-svn-id: https://develop.svn.wordpress.org/trunk@56202 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -26,9 +26,18 @@ class WP_Navigation_Fallback {
|
||||
*/
|
||||
public static function get_fallback() {
|
||||
|
||||
/**
|
||||
* Filters whether or not a fallback should be created.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param bool Whether to create a fallback navigation menu. Default true.
|
||||
*/
|
||||
$should_create_fallback = apply_filters( 'wp_navigation_should_create_fallback', true );
|
||||
|
||||
$fallback = static::get_most_recently_published_navigation();
|
||||
|
||||
if ( $fallback ) {
|
||||
if ( $fallback || ! $should_create_fallback ) {
|
||||
return $fallback;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user