Changeset 12656
- Timestamp:
- 01/08/2010 08:29:55 AM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/deprecated.php
r12526 r12656 1900 1900 return before_last_bar( _n( $single, $plural, $number, $domain ) ); 1901 1901 } 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 */ 1913 function get_alloptions() { 1914 _deprecated_function( __FUNCTION__, '3.0', 'wp_load_alloptions()' ); 1915 return wp_load_alloptions(); 1916 } 1902 1917 ?> -
trunk/wp-includes/functions.php
r12616 r12656 401 401 402 402 /** 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 411 406 * @package WordPress 412 407 * @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 408 * 416 409 * @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 :)" -- Dougal428 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 the440 * options and will return the cached options when called again.441 *442 * @since 2.2.0443 * @package WordPress444 * @subpackage Option445 *446 * @return array List all options.447 410 */ 448 411 function wp_load_alloptions() {
Note: See TracChangeset
for help on using the changeset viewer.