WordPress.org

Make WordPress Core

Ticket #4915: 4915.patch

File 4915.patch, 2.6 KB (added by hakre, 9 years ago)
  • wp-includes/functions.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    400400}
    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
    411  * @package WordPress
    412  * @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.
    415  *
    416  * @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 /**
    437403 * Loads and caches all autoloaded options, if available or all options.
    438404 *
    439405 * This is different from get_alloptions(), in that this function will cache the
  • wp-includes/deprecated.php

     
    16901690        the_author_meta('ID');
    16911691}
    16921692
     1693/**
     1694 * Retrieve all autoload options or all options, if no autoloaded ones exist.
     1695 *
     1696 * This is different from wp_load_alloptions() in that this function does not
     1697 * cache its results and will retrieve all options from the database every time
     1698 *
     1699 * it is called.
     1700 *
     1701 * @since 1.0.0
     1702 * @deprecated 2.9
     1703 * @package WordPress
     1704 * @subpackage Option
     1705 *
     1706 * @return array List of all options.
     1707 */
     1708function get_alloptions() {
     1709        _deprecated_function(__FUNCTION__, '2.9');
     1710}
    16931711?>
     1712 No newline at end of file