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
3088                if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ) {
3089                     /**
3090                      * Filters the single post for preview mode.
3091                      *
3092                      * @since 2.7.0
3093                      *
3094                      * @param WP_Post  $post_preview  The Post object.
3095                      * @param WP_Query $this          The WP_Query instance (passed by reference).
3096                      */
3097                     $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );
3098                }
3099           }
3100
3101           // Put sticky posts at the top of the posts array
3102           $sticky_posts = get_option( 'sticky_posts' );
3103           if ( $this->is_home && $page <= 1 && is_array( $sticky_posts ) && ! empty( $sticky_posts ) && ! $q['ignore_sticky_posts'] ) {
3104                $num_posts     = count( $this->posts );
3105                $sticky_offset = 0;
3106                // Loop over posts and relocate stickies to the front.