Source View: add_option_{$option}

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

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

Source View

Line Code
329      }
330
331      // This option exists now
332      $notoptions = wp_cache_get( 'notoptions', 'options' ); // yes, again... we need it to be fresh
333      if ( is_array( $notoptions ) && isset( $notoptions[$option] ) ) {
334           unset( $notoptions[$option] );
335           wp_cache_set( 'notoptions', $notoptions, 'options' );
336      }
337
338      do_action( "add_option_{$option}", $option, $value );
339      do_action( 'added_option', $option, $value );
340      return true;
341 }
342
343 /**
344  * Removes option by name. Prevents removal of protected WordPress options.
345  *
346  * @package WordPress
347  * @subpackage Option