From e162ffa2e9959615b0bd0f9889ddc8253e6a17f2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 15 Dec 2023 12:59:23 +0000 Subject: [PATCH] Docs: Document the `$link` global in `get_bookmark()`. Follow-up to [8758]. Props upadalavipul, mukesh27. See #60021. Built from https://develop.svn.wordpress.org/trunk@57191 git-svn-id: http://core.svn.wordpress.org/trunk@56702 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/bookmark.php | 13 +++++++------ wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index 47a86d865d..66c4339638 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -11,7 +11,8 @@ * * @since 2.1.0 * - * @global wpdb $wpdb WordPress database abstraction object. + * @global object $link Current link object. + * @global wpdb $wpdb WordPress database abstraction object. * * @param int|stdClass $bookmark * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which @@ -21,11 +22,11 @@ * @return array|object|null Type returned depends on $output value. */ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) { - global $wpdb; + global $link, $wpdb; if ( empty( $bookmark ) ) { - if ( isset( $GLOBALS['link'] ) ) { - $_bookmark = & $GLOBALS['link']; + if ( isset( $link ) ) { + $_bookmark = &$link; } else { $_bookmark = null; } @@ -33,8 +34,8 @@ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) { wp_cache_add( $bookmark->link_id, $bookmark, 'bookmark' ); $_bookmark = $bookmark; } else { - if ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) { - $_bookmark = & $GLOBALS['link']; + if ( isset( $link ) && ( $link->link_id == $bookmark ) ) { + $_bookmark = &$link; } else { $_bookmark = wp_cache_get( $bookmark, 'bookmark' ); if ( ! $_bookmark ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 649c9e16e8..dea4987e30 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57190'; +$wp_version = '6.5-alpha-57191'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.