Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: the_preview

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
2290                               }
2291                          } else {
2292                               if (! current_user_can('read_post', $this->posts[0]->ID))
2293                                    $this->posts = array();
2294                          }
2295                     }
2296                }
2297
2298                if ( $this->is_preview && current_user_can( "edit_{$post_type}", $this->posts[0]->ID ) )
2299                     $this->posts[0] = apply_filters('the_preview', $this->posts[0]);
2300           }
2301
2302           // Put sticky posts at the top of the posts array
2303           $sticky_posts = get_option('sticky_posts');
2304           if ( $this->is_home && $page <= 1 && !empty($sticky_posts) && !$q['caller_get_posts'] ) {
2305                $num_posts = count($this->posts);
2306                $sticky_offset = 0;
2307                // Loop over posts and relocate stickies to the front.
2308                for ( $i = 0; $i < $num_posts; $i++ ) {