Make WordPress Core

Ticket #54736: get_sample_permalink_post_filter_original.patch

File get_sample_permalink_post_filter_original.patch, 944 bytes (added by herregroen, 3 years ago)
  • src/wp-admin/includes/post.php

    diff --git src/wp-admin/includes/post.php src/wp-admin/includes/post.php
    index c9b29b5df4..866e4a1e4d 100644
    function get_sample_permalink( $id, $title = null, $name = null ) { 
    13911391        $original_status = $post->post_status;
    13921392        $original_date   = $post->post_date;
    13931393        $original_name   = $post->post_name;
     1394        $original_filter = $post->filter;
    13941395
    13951396        // Hack: get_permalink() would return plain permalink for drafts, so we will fake that our post is published.
    13961397        if ( in_array( $post->post_status, array( 'draft', 'pending', 'future' ), true ) ) {
    function get_sample_permalink( $id, $title = null, $name = null ) { 
    14351436        $post->post_status = $original_status;
    14361437        $post->post_date   = $original_date;
    14371438        $post->post_name   = $original_name;
    1438         unset( $post->filter );
     1439        $post->filter      = $original_filter;
    14391440
    14401441        /**
    14411442         * Filters the sample permalink.