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
82 <div id="save-action">
83 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status )  { ?>
84 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
85 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
86 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
87 <?php } ?>
88 </div>
89
90 <div id="preview-action">
91 <?php $preview_link = 'publish' == $post->post_status ? clean_url(get_permalink($post->ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>
92
93 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php _e('Preview'); ?></a>
94 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
95 </div>
96
97 <div class="clear"></div>
98 </div><?php // /minor-publishing-actions ?>
99
100 <div id="misc-publishing-actions">