WordPress.org

Make WordPress Core

Changeset 12656


Ignore:
Timestamp:
01/08/10 08:29:55 (5 years ago)
Author:
westi
Message:

Deprecate get_alloptions(). Fixes #4915 props nacin.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r12526 r12656  
    19001900    return before_last_bar( _n( $single, $plural, $number, $domain ) ); 
    19011901} 
     1902 
     1903/** 
     1904 * Retrieve all autoload options, or all options if no autoloaded ones exist. 
     1905 * 
     1906 * @since 1.0.0 
     1907 * @deprecated 3.0.0 
     1908 * @deprecated Use wp_load_alloptions()) 
     1909 * @see wp_load_alloptions() 
     1910 * 
     1911 * @return array List of all options. 
     1912 */ 
     1913function get_alloptions() { 
     1914    _deprecated_function( __FUNCTION__, '3.0', 'wp_load_alloptions()' ); 
     1915    return wp_load_alloptions(); 
     1916} 
    19021917?> 
  • trunk/wp-includes/functions.php

    r12616 r12656  
    401401 
    402402/** 
    403  * Retrieve all autoload options or all options, if no autoloaded ones exist. 
    404  * 
    405  * This is different from wp_load_alloptions() in that this function does not 
    406  * cache its results and will retrieve all options from the database every time 
    407  * 
    408  * it is called. 
    409  * 
    410  * @since 1.0.0 
     403 * Loads and caches all autoloaded options, if available or all options. 
     404 * 
     405 * @since 2.2.0 
    411406 * @package WordPress 
    412407 * @subpackage Option 
    413  * @uses apply_filters() Calls 'pre_option_$optionname' hook with option value as parameter. 
    414  * @uses apply_filters() Calls 'all_options' on options list. 
    415408 * 
    416409 * @return array List of all options. 
    417  */ 
    418 function get_alloptions() { 
    419     global $wpdb; 
    420     $show = $wpdb->hide_errors(); 
    421     if ( !$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) ) 
    422         $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ); 
    423     $wpdb->show_errors($show); 
    424  
    425     foreach ( (array) $options as $option ) { 
    426         // "When trying to design a foolproof system, 
    427         //  never underestimate the ingenuity of the fools :)" -- Dougal 
    428         if ( in_array( $option->option_name, array( 'siteurl', 'home', 'category_base', 'tag_base' ) ) ) 
    429             $option->option_value = untrailingslashit( $option->option_value ); 
    430         $value = maybe_unserialize( $option->option_value ); 
    431         $all_options->{$option->option_name} = apply_filters( 'pre_option_' . $option->option_name, $value ); 
    432     } 
    433     return apply_filters( 'all_options', $all_options ); 
    434 } 
    435  
    436 /** 
    437  * Loads and caches all autoloaded options, if available or all options. 
    438  * 
    439  * This is different from get_alloptions(), in that this function will cache the 
    440  * options and will return the cached options when called again. 
    441  * 
    442  * @since 2.2.0 
    443  * @package WordPress 
    444  * @subpackage Option 
    445  * 
    446  * @return array List all options. 
    447410 */ 
    448411function wp_load_alloptions() { 
Note: See TracChangeset for help on using the changeset viewer.