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 |
---|---|
85 | if ( current_user_can( 'manage_categories' ) ) { |
86 | $cats_text = "<a href='categories.php'>$cats_text</a>"; |
87 | $tags_text = "<a href='edit-tags.php'>$tags_text</a>"; |
88 | } |
89 |
|
90 | $post_type_text = implode(', ', $post_type_texts); |
91 |
|
92 | // There is always a category |
93 | $sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s' ), $post_type_text, $cats_text, $tags_text, $pending_text ); |
94 | $sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text ); |
95 |
|
96 | ?> |
97 | <p class="youhave"><?php echo $sentence; ?></p> |
98 | <?php |
99 | $ct = current_theme_info(); |
100 | $sidebars_widgets = wp_get_sidebars_widgets(); |
101 | $num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) ); |
102 | $widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets ); |
103 | if ( $can_switch_themes = current_user_can( 'switch_themes' ) ) |