Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: option_{$setting}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 4 times in this file.

Line Code
235           return false;
236
237      if ( empty($cache_settings) )
238           $cache_settings = get_alloptions();
239
240      if ( empty($cache_nonexistantoptions) )
241           $cache_nonexistantoptions = array();
242
243      if ('home' == $setting && '' == $cache_settings->home)
244           return apply_filters('option_' . $setting, $cache_settings->siteurl);
245
246      if ( isset($cache_settings->$setting) ) :
247           return apply_filters('option_' . $setting, $cache_settings->$setting);
248      else :
249           // for these cases when we're asking for an unknown option
250           if ( isset($cache_nonexistantoptions[$setting]) )
251                return false;
252
253           $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
254
255           if (!$option) :
256                $cache_nonexistantoptions[$setting] = true;
257                return false;
258           endif;
259
260           @ $kellogs = unserialize($option);
261           if ($kellogs !== FALSE)
262                return apply_filters('option_' . $setting, $kellogs);
263           else return apply_filters('option_' . $setting, $option);
264      endif;
265 }
266
267 function get_option($option) {
268      return get_settings($option);
269 }
270
271 function form_option($option) {
272      echo htmlspecialchars( get_option($option), ENT_QUOTES );