WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
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.
Line | Code |
---|---|
232 | * Filters the default avatars. |
233 | * |
234 | * Avatars are stored in key/value pairs, where the key is option value, |
235 | * and the name is the displayed avatar name. |
236 | * |
237 | * @since 2.6.0 |
238 | * |
239 | * @param array $avatar_defaults Array of default avatars. |
240 | */ |
241 | $avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults ); |
242 | $default = get_option( 'avatar_default', 'mystery' ); |
243 | $avatar_list = ''; |
244 |
|
245 | // Force avatars on to display these choices |
246 | add_filter( 'pre_option_show_avatars', '__return_true', 100 ); |
247 |
|
248 | foreach ( $avatar_defaults as $default_key => $default_name ) { |
249 | $selected = ($default == $default_key) ? 'checked="checked" ' : ''; |
250 | $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> "; |