Make sure the menu position is valid.
If the menu position is unavailable, it will loop through the positions until one is found that is available.
beans_admin_menu_position( int $position )
Return: (bool) Valid postition.
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
$position | int | true | - | The desired position. |
Source
function beans_admin_menu_position( $position ) {
global $menu;
if ( ! is_array( $position ) ) {
return $position;
}
if ( array_key_exists( $position, $menu ) ) {
return beans_admin_menu_position( $position + 1 );
}
return $position;
}