Correct @return value for wp_create_nav_menu() and wp_delete_nav_menu().
props Tmeister. fixes #27745. Built from https://develop.svn.wordpress.org/trunk@28242 git-svn-id: http://core.svn.wordpress.org/trunk@28070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3ad1c8897c
commit
7214648764
|
@ -15,7 +15,7 @@
|
||||||
* @uses get_term
|
* @uses get_term
|
||||||
* @uses get_term_by
|
* @uses get_term_by
|
||||||
*
|
*
|
||||||
* @param string $menu Menu id, slug or name
|
* @param string $menu Menu ID, slug, or name.
|
||||||
* @return mixed false if $menu param isn't supplied or term does not exist, menu object if successful.
|
* @return mixed false if $menu param isn't supplied or term does not exist, menu object if successful.
|
||||||
*/
|
*/
|
||||||
function wp_get_nav_menu_object( $menu ) {
|
function wp_get_nav_menu_object( $menu ) {
|
||||||
|
@ -43,7 +43,7 @@ function wp_get_nav_menu_object( $menu ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param int|string $menu The menu to check (id, slug, or name)
|
* @param int|string $menu The menu to check (ID, slug, or name).
|
||||||
* @return bool Whether the menu exists.
|
* @return bool Whether the menu exists.
|
||||||
*/
|
*/
|
||||||
function is_nav_menu( $menu ) {
|
function is_nav_menu( $menu ) {
|
||||||
|
@ -163,8 +163,8 @@ function is_nav_menu_item( $menu_item_id = 0 ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param string $menu_name Menu Name
|
* @param string $menu_name Menu name.
|
||||||
* @return mixed Menu object on success|WP_Error on failure
|
* @return int|WP_Error Menu ID on success, WP_Error object on failure.
|
||||||
*/
|
*/
|
||||||
function wp_create_nav_menu( $menu_name ) {
|
function wp_create_nav_menu( $menu_name ) {
|
||||||
return wp_update_nav_menu_object( 0, array( 'menu-name' => $menu_name ) );
|
return wp_update_nav_menu_object( 0, array( 'menu-name' => $menu_name ) );
|
||||||
|
@ -175,8 +175,8 @@ function wp_create_nav_menu( $menu_name ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*
|
*
|
||||||
* @param string $menu name|id|slug
|
* @param string $menu Menu ID, slug, or name.
|
||||||
* @return mixed Menu object on success|WP_Error on failure
|
* @return bool|WP_Error True on success, false or WP_Error object on failure.
|
||||||
*/
|
*/
|
||||||
function wp_delete_nav_menu( $menu ) {
|
function wp_delete_nav_menu( $menu ) {
|
||||||
$menu = wp_get_nav_menu_object( $menu );
|
$menu = wp_get_nav_menu_object( $menu );
|
||||||
|
@ -221,7 +221,7 @@ function wp_delete_nav_menu( $menu ) {
|
||||||
*
|
*
|
||||||
* @param int $menu_id The ID of the menu or "0" to create a new menu.
|
* @param int $menu_id The ID of the menu or "0" to create a new menu.
|
||||||
* @param array $menu_data The array of menu data.
|
* @param array $menu_data The array of menu data.
|
||||||
* @return int|WP_Error object The menu's ID or WP_Error object.
|
* @return int|WP_Error Menu ID on success, WP_Error object on failure.
|
||||||
*/
|
*/
|
||||||
function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {
|
function wp_update_nav_menu_object( $menu_id = 0, $menu_data = array() ) {
|
||||||
$menu_id = (int) $menu_id;
|
$menu_id = (int) $menu_id;
|
||||||
|
|
Loading…
Reference in New Issue