summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php')
-rw-r--r--plugins/jetpack/json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php
index c77ce8d3..fe61e71a 100644
--- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php
+++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-menus-v1-1-endpoint.php
@@ -454,11 +454,14 @@ class WPCOM_JSON_API_Menus_Complexify extends WPCOM_JSON_API_Menus_Translator {
protected function location_name_exists( $location_name ) {
$widget_location_names = wp_list_pluck( WPCOM_JSON_API_Menus_Widgets::get(), 'name' );
+ $existing_locations = get_nav_menu_locations();
+
if ( ! is_array( get_registered_nav_menus() ) ) {
return false;
}
return array_key_exists( $location_name, get_registered_nav_menus() ) ||
+ array_key_exists( $location_name, $existing_locations ) ||
in_array( $location_name, $widget_location_names );
}