From 8e56669a49dafd6231b3dfdf58d0ffd1aa3ae5f7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 15 Dec 2023 14:31:56 +0000 Subject: [PATCH] General: Revert code changes from [57191]. The unit tests for `get_bookmark()` expect the function to modify the `$GLOBALS` array directly. Follow-up to [57191]. See #60021. git-svn-id: https://develop.svn.wordpress.org/trunk@57192 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/bookmark.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/bookmark.php b/src/wp-includes/bookmark.php index 66c4339638..7513a5622c 100644 --- a/src/wp-includes/bookmark.php +++ b/src/wp-includes/bookmark.php @@ -22,11 +22,11 @@ * @return array|object|null Type returned depends on $output value. */ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) { - global $link, $wpdb; + global $wpdb; if ( empty( $bookmark ) ) { - if ( isset( $link ) ) { - $_bookmark = &$link; + if ( isset( $GLOBALS['link'] ) ) { + $_bookmark = & $GLOBALS['link']; } else { $_bookmark = null; } @@ -34,8 +34,8 @@ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) { wp_cache_add( $bookmark->link_id, $bookmark, 'bookmark' ); $_bookmark = $bookmark; } else { - if ( isset( $link ) && ( $link->link_id == $bookmark ) ) { - $_bookmark = &$link; + if ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) { + $_bookmark = & $GLOBALS['link']; } else { $_bookmark = wp_cache_get( $bookmark, 'bookmark' ); if ( ! $_bookmark ) {