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
765                               $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash' ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
766                          if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
767                               $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
768                     }
769                     if ( $post_type_object->public ) {
770                          if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
771                               if ( $can_edit_post ) {
772                                    $preview_link = set_url_scheme( get_permalink( $post->ID ) );
773                                    /** This filter is documented in wp-admin/includes/meta-boxes.php */
774                                    $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
775                                    $actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
776                               }
777                          } elseif ( 'trash' != $post->post_status ) {
778                               $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
779                          }
780                     }
781
782                     if ( is_post_type_hierarchical( $post->post_type ) ) {
783