From 9e4d80b259369146b53bbc16955aeed73ba175e9 Mon Sep 17 00:00:00 2001 From: westi Date: Fri, 8 Jan 2010 08:29:55 +0000 Subject: [PATCH] Deprecate get_alloptions(). Fixes #4915 props nacin. git-svn-id: http://svn.automattic.com/wordpress/trunk@12656 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/deprecated.php | 15 +++++++++++++++ wp-includes/functions.php | 39 +------------------------------------- 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 3b55bb432..4386bb56f 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -1899,4 +1899,19 @@ function _nc( $single, $plural, $number, $domain = 'default' ) { _deprecated_function(__FUNCTION__, '2.9', '_nx' ); return before_last_bar( _n( $single, $plural, $number, $domain ) ); } + +/** + * Retrieve all autoload options, or all options if no autoloaded ones exist. + * + * @since 1.0.0 + * @deprecated 3.0.0 + * @deprecated Use wp_load_alloptions()) + * @see wp_load_alloptions() + * + * @return array List of all options. + */ +function get_alloptions() { + _deprecated_function( __FUNCTION__, '3.0', 'wp_load_alloptions()' ); + return wp_load_alloptions(); +} ?> diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 01235988e..e13c2d42c 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -399,51 +399,14 @@ function form_option( $option ) { echo esc_attr(get_option( $option ) ); } -/** - * Retrieve all autoload options or all options, if no autoloaded ones exist. - * - * This is different from wp_load_alloptions() in that this function does not - * cache its results and will retrieve all options from the database every time - * - * it is called. - * - * @since 1.0.0 - * @package WordPress - * @subpackage Option - * @uses apply_filters() Calls 'pre_option_$optionname' hook with option value as parameter. - * @uses apply_filters() Calls 'all_options' on options list. - * - * @return array List of all options. - */ -function get_alloptions() { - global $wpdb; - $show = $wpdb->hide_errors(); - if ( !$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) ) - $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ); - $wpdb->show_errors($show); - - foreach ( (array) $options as $option ) { - // "When trying to design a foolproof system, - // never underestimate the ingenuity of the fools :)" -- Dougal - if ( in_array( $option->option_name, array( 'siteurl', 'home', 'category_base', 'tag_base' ) ) ) - $option->option_value = untrailingslashit( $option->option_value ); - $value = maybe_unserialize( $option->option_value ); - $all_options->{$option->option_name} = apply_filters( 'pre_option_' . $option->option_name, $value ); - } - return apply_filters( 'all_options', $all_options ); -} - /** * Loads and caches all autoloaded options, if available or all options. * - * This is different from get_alloptions(), in that this function will cache the - * options and will return the cached options when called again. - * * @since 2.2.0 * @package WordPress * @subpackage Option * - * @return array List all options. + * @return array List of all options. */ function wp_load_alloptions() { global $wpdb;