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.
Built from https://develop.svn.wordpress.org/trunk@57192


git-svn-id: http://core.svn.wordpress.org/trunk@56703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-12-15 14:33:25 +00:00
parent e162ffa2e9
commit f0e266fd62
2 changed files with 6 additions and 6 deletions

View File

@ -22,11 +22,11 @@
* @return array|object|null Type returned depends on $output value. * @return array|object|null Type returned depends on $output value.
*/ */
function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) { function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {
global $link, $wpdb; global $wpdb;
if ( empty( $bookmark ) ) { if ( empty( $bookmark ) ) {
if ( isset( $link ) ) { if ( isset( $GLOBALS['link'] ) ) {
$_bookmark = &$link; $_bookmark = & $GLOBALS['link'];
} else { } else {
$_bookmark = null; $_bookmark = null;
} }
@ -34,8 +34,8 @@ function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {
wp_cache_add( $bookmark->link_id, $bookmark, 'bookmark' ); wp_cache_add( $bookmark->link_id, $bookmark, 'bookmark' );
$_bookmark = $bookmark; $_bookmark = $bookmark;
} else { } else {
if ( isset( $link ) && ( $link->link_id == $bookmark ) ) { if ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) {
$_bookmark = &$link; $_bookmark = & $GLOBALS['link'];
} else { } else {
$_bookmark = wp_cache_get( $bookmark, 'bookmark' ); $_bookmark = wp_cache_get( $bookmark, 'bookmark' );
if ( ! $_bookmark ) { if ( ! $_bookmark ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.5-alpha-57191'; $wp_version = '6.5-alpha-57192';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.