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-admin/includes/ajax-actions.php

    r34163 r34170  
    15281528    check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
    15291529    $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0;
    1530     wp_die( add_query_arg( array( 'preview' => 'true' ), get_permalink( $post_id ) ) );
     1530    wp_die( get_preview_post_link( $post_id ) );
    15311531}
    15321532
Note: See TracChangeset for help on using the changeset viewer.