Skip to content

Commit

Permalink
Replace isset() with empty() check. When the menu is not assigned to …
Browse files Browse the repository at this point in the history
…the menu location, it returns 0 and generates a PHP warning. It will become a fatal error in PHP8. (#63)
  • Loading branch information
sathyapulse committed Feb 28, 2022
1 parent 4188817 commit b54d325
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/wp-api-menus-v2.php
Expand Up @@ -267,7 +267,7 @@ public function get_menu_location( $request ) {
$location = $params['location'];
$locations = get_nav_menu_locations();

if ( ! isset( $locations[ $location ] ) ) {
if ( empty( $locations[ $location ] ) ) {
return array();
}

Expand Down

0 comments on commit b54d325

Please sign in to comment.