Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: preview_post_link

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
48      /**
49       * Filter the URI of a post preview in the post submit box.
50       *
51       * @since 2.0.5
52       * @since 4.0.0 $post parameter was added.
53       *
54       * @param string  $preview_link URI the user will be directed to for a post preview.
55       * @param WP_Post $post         Post object.
56       */
57      $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ) );
58      $preview_button = __( 'Preview' );
59 }
60 ?>
61 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a>
62 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
63 </div>
64 <?php endif; // public post type ?>
65 <div class="clear"></div>
66 </div><!-- #minor-publishing-actions -->