From a940c08357a564e6c20acc3e4647b6cabbaa96ba Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 3 Nov 2020 03:52:10 +0000 Subject: [PATCH] Docs: Document the `$linkdata` parameter of `wp_insert_link()` using hash notation. Props stevenlinx, peterwilsoncc. Fixes #50853. Built from https://develop.svn.wordpress.org/trunk@49487 git-svn-id: http://core.svn.wordpress.org/trunk@49246 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/bookmark.php | 27 ++++++++++++++++++++++++--- wp-includes/version.php | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 622ea06955..6cc6683f02 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -142,13 +142,34 @@ function get_link_to_edit( $link ) { } /** - * Inserts/updates links into/in the database. + * Inserts a link into the database, or updates an existing link. + * + * Runs all the necessary sanitizing, provides default values if arguments are missing, + * and finally saves the link. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param array $linkdata Elements that make up the link to insert. + * @param array $linkdata { + * Elements that make up the link to insert. + * + * @type int $link_id Optional. The ID of the existing link if updating. + * @type string $link_url The URL the link points to. + * @type string $link_name The title of the link. + * @type string $link_image Optional. A URL of an image. + * @type string $link_target Optional. The target element for the anchor tag. + * @type string $link_description Optional. A short description of the link. + * @type string $link_visible Optional. 'Y' means visible, anything else means not. + * @type int $link_owner Optional. A user ID. + * @type int $link_rating Optional. A rating for the link. + * @type string $link_updated Optional. When the link was last updated. + * @type string $link_rel Optional. A relationship of the link to you. + * @type string $link_notes Optional. An extended description of or notes on the link. + * @type string $link_rss Optional. A URL of an associated RSS feed. + * @type int $link_category Optional. The term ID of the link category. + * If empty, uses default link category. + * } * @param bool $wp_error Optional. Whether to return a WP_Error object on failure. Default false. * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success. */ @@ -274,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. + * @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. */ function wp_update_link( $linkdata ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 11400484af..c8cf5f3c97 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta3-49486'; +$wp_version = '5.6-beta3-49487'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.