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 |
---|---|
2301 | } |
2302 | } else { |
2303 | if (! current_user_can('read_post', $this->posts[0]->ID)) |
2304 | $this->posts = array(); |
2305 | } |
2306 | } |
2307 | } |
2308 |
|
2309 | if ( $this->is_preview && current_user_can( "edit_{$post_type}", $this->posts[0]->ID ) ) |
2310 | $this->posts[0] = apply_filters('the_preview', $this->posts[0]); |
2311 | } |
2312 |
|
2313 | // Put sticky posts at the top of the posts array |
2314 | $sticky_posts = get_option('sticky_posts'); |
2315 | if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['caller_get_posts'] ) { |
2316 | $num_posts = count($this->posts); |
2317 | $sticky_offset = 0; |
2318 | // Loop over posts and relocate stickies to the front. |
2319 | for ( $i = 0; $i < $num_posts; $i++ ) { |