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
34 <?php } ?>
35 </div>
36
37 <div id="preview-action">
38 <?php
39 if ( 'publish' == $post->post_status ) {
40      $preview_link = esc_url(get_permalink($post->ID));
41      $preview_button = __('Preview Changes');
42 } else {
43      $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
44      $preview_button = __('Preview');
45 }
46 ?>
47 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
48 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
49 </div>
50
51 <div class="clear"></div>
52 </div><?php // /minor-publishing-actions ?>