Skip to content

code quality: explicitly return null in wp_get_nav_menu_to_edit() #8683

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/wp-admin/includes/nav-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,8 @@ function _wp_nav_menu_meta_box_object( $data_object = null ) {
* @since 3.0.0
*
* @param int $menu_id Optional. The ID of the menu to format. Default 0.
* @return string|WP_Error The menu formatted to edit or error object on failure.
* @return string|WP_Error|null The menu formatted to edit or error object on failure.
* Null if the $menu_id param isn't supplied or term doesn't exist.
*/
function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
$menu = wp_get_nav_menu_object( $menu_id );
Expand Down Expand Up @@ -1321,6 +1322,8 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
} elseif ( is_wp_error( $menu ) ) {
return $menu;
}

return null;
}

/**
Expand Down
Loading