Make WordPress Core

Changeset 57192


Ignore:
Timestamp:
12/15/2023 02:31:56 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/bookmark.php

    r57191 r57192  
    2323 */
    2424function get_bookmark( $bookmark, $output = OBJECT, $filter = 'raw' ) {
    25         global $link, $wpdb;
     25        global $wpdb;
    2626
    2727        if ( empty( $bookmark ) ) {
    28                 if ( isset( $link ) ) {
    29                         $_bookmark = &$link;
     28                if ( isset( $GLOBALS['link'] ) ) {
     29                        $_bookmark = & $GLOBALS['link'];
    3030                } else {
    3131                        $_bookmark = null;
     
    3535                $_bookmark = $bookmark;
    3636        } else {
    37                 if ( isset( $link ) && ( $link->link_id == $bookmark ) ) {
    38                         $_bookmark = &$link;
     37                if ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) {
     38                        $_bookmark = & $GLOBALS['link'];
    3939                } else {
    4040                        $_bookmark = wp_cache_get( $bookmark, 'bookmark' );
Note: See TracChangeset for help on using the changeset viewer.