Make WordPress Core


Ignore:
Timestamp:
09/15/2015 04:14:23 AM (9 years ago)
Author:
wonderboymusic
Message:

Create a function, get_preview_post_link(), to DRY the logic for applying the 'preview_post_link' filter to a URL.

Props TomHarrigan, wonderboymusic.
Fixes #24345.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r34122 r34170  
    551551        {
    552552            if ( 'draft' == $post->post_status ) {
    553                 $preview_link = set_url_scheme( get_permalink( $post->ID ) );
    554                 /** This filter is documented in wp-admin/includes/meta-boxes.php */
    555                 $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
     553                $draft_link = set_url_scheme( get_permalink( $post->ID ) );
     554                $preview_link = get_preview_post_link( $post, array(), $draft_link );
    556555                $wp_admin_bar->add_menu( array(
    557556                    'id' => 'preview',
Note: See TracChangeset for help on using the changeset viewer.