From 8bfdfb5994f8901abae5462dd6bf5fcd4d354f11 Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Sat, 28 Feb 2026 20:04:55 +0100 Subject: [PATCH 1/5] Fix documented return type for add_link(), edit_link(), wp_update_link() --- src/wp-admin/includes/bookmark.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index 03e8b1201ce9d..b936f07ca4e32 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -11,7 +11,7 @@ * * @since 2.0.0 * - * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success. + * @return int 0 on failure. The link ID on success. */ function add_link() { return edit_link(); @@ -23,7 +23,7 @@ function add_link() { * @since 2.0.0 * * @param int $link_id Optional. ID of the link to edit. Default 0. - * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success. + * @return int 0 on failure. The link ID on success. */ function edit_link( $link_id = 0 ) { if ( ! current_user_can( 'manage_links' ) ) { @@ -295,7 +295,7 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { * @since 2.0.0 * * @param array $linkdata Link data to update. See wp_insert_link() for accepted arguments. - * @return int|WP_Error Value 0 or WP_Error on failure. The updated link ID on success. + * @return int 0 on failure. The updated link ID on success. */ function wp_update_link( $linkdata ) { $link_id = (int) $linkdata['link_id']; From 21c085014a0bf327ef90c907678ce0d17e81e102 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 1 Mar 2026 02:44:46 +0100 Subject: [PATCH 2/5] Update src/wp-admin/includes/bookmark.php Co-authored-by: Christoph Daum --- src/wp-admin/includes/bookmark.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index b936f07ca4e32..fe51570b19240 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -295,7 +295,7 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { * @since 2.0.0 * * @param array $linkdata Link data to update. See wp_insert_link() for accepted arguments. - * @return int 0 on failure. The updated link ID on success. + * @return int The updated link ID on success. 0 on failure. */ function wp_update_link( $linkdata ) { $link_id = (int) $linkdata['link_id']; From b5ed63f9a1d79d307fdc988d73a4d8685ba33d5c Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 1 Mar 2026 02:45:11 +0100 Subject: [PATCH 3/5] Update src/wp-admin/includes/bookmark.php Co-authored-by: Christoph Daum --- src/wp-admin/includes/bookmark.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index fe51570b19240..e5477910b8054 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -23,7 +23,7 @@ function add_link() { * @since 2.0.0 * * @param int $link_id Optional. ID of the link to edit. Default 0. - * @return int 0 on failure. The link ID on success. + * @return int|never The link ID on success. 0 on failure. Exits when unauthorized. */ function edit_link( $link_id = 0 ) { if ( ! current_user_can( 'manage_links' ) ) { From 4af2b61e1884723c62e60841336daea501821cb6 Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 1 Mar 2026 02:46:33 +0100 Subject: [PATCH 4/5] Revert "Update src/wp-admin/includes/bookmark.php" This reverts commit b5ed63f9a1d79d307fdc988d73a4d8685ba33d5c. --- src/wp-admin/includes/bookmark.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index e5477910b8054..fe51570b19240 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -23,7 +23,7 @@ function add_link() { * @since 2.0.0 * * @param int $link_id Optional. ID of the link to edit. Default 0. - * @return int|never The link ID on success. 0 on failure. Exits when unauthorized. + * @return int 0 on failure. The link ID on success. */ function edit_link( $link_id = 0 ) { if ( ! current_user_can( 'manage_links' ) ) { From 86ea883b4e53a704fe44d33c1747bf2a5fbc5edb Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Sun, 1 Mar 2026 02:48:33 +0100 Subject: [PATCH 5/5] Update bookmark.php --- src/wp-admin/includes/bookmark.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index fe51570b19240..e8a98c13ca729 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -11,7 +11,7 @@ * * @since 2.0.0 * - * @return int 0 on failure. The link ID on success. + * @return int The link ID on success. 0 on failure. */ function add_link() { return edit_link(); @@ -23,7 +23,7 @@ function add_link() { * @since 2.0.0 * * @param int $link_id Optional. ID of the link to edit. Default 0. - * @return int 0 on failure. The link ID on success. + * @return int The link ID on success. 0 on failure. */ function edit_link( $link_id = 0 ) { if ( ! current_user_can( 'manage_links' ) ) {