Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: avatar_defaults

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

Line Code
251  * Filter the default avatars.
252  *
253  * Avatars are stored in key/value pairs, where the key is option value,
254  * and the name is the displayed avatar name.
255  *
256  * @since 2.6.0
257  *
258  * @param array $avatar_defaults Array of default avatars.
259  */
260 $avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );
261 $default = get_option( 'avatar_default', 'mystery' );
262 $size = 32;
263 $avatar_list = '';
264
265 // Force avatars on to display these choices
266 add_filter( 'pre_option_show_avatars', '__return_true', 100 );
267
268 foreach ( $avatar_defaults as $default_key => $default_name ) {
269      $selected = ($default == $default_key) ? 'checked="checked" ' : '';