Make WordPress Core


Ignore:
Timestamp:
08/03/2012 05:51:42 PM (12 years ago)
Author:
ryan
Message:

Deprecate get_blog_option(), add_blog_option(), update_blog_option(), and delete_blog_option().

Use the regular option functions wrapped in switch_to_blog() and restore_current_blog() instead.

Group multiple operations within a single switch where possible.

fixes #21432

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r21413 r21414  
    18971897        $scheme = is_ssl() && !is_admin() ? 'https' : 'http';
    18981898
    1899     if ( empty( $blog_id ) || !is_multisite() )
     1899    if ( empty( $blog_id ) || !is_multisite() ) {
    19001900        $url = get_option( 'home' );
    1901     else
    1902         $url = get_blog_option( $blog_id, 'home' );
     1901    } else {
     1902        switch_to_blog( $blog_id );
     1903        $url = get_option( 'home' );
     1904        restore_current_blog();
     1905    }
    19031906
    19041907    if ( 'relative' == $scheme )
     
    19621965    }
    19631966
    1964     if ( empty( $blog_id ) || !is_multisite() )
     1967    if ( empty( $blog_id ) || !is_multisite() ) {
    19651968        $url = get_option( 'siteurl' );
    1966     else
    1967         $url = get_blog_option( $blog_id, 'siteurl' );
     1969    } else {
     1970        switch_to_blog( $blog_id );
     1971        $url = get_option( 'siteurl' );
     1972        restore_current_blog();
     1973    }
    19681974
    19691975    if ( 'relative' == $scheme )
Note: See TracChangeset for help on using the changeset viewer.