Make WordPress Core


Ignore:
Timestamp:
02/02/2015 04:49:23 PM (10 years ago)
Author:
boonebgorges
Message:

In get_sample_permalink(), override 'future' status before generating permalink.

In [31114], get_permalink() was modified to prevent pretty permalinks from
being generated for posts with the 'future' post status. This inadvertently
broke the pretty permalink preview for scheduled posts. The fix is to include
the 'future' status in the list of statuses that get_sample_permalink() fakes
as 'publish' before it fetches a permalink.

Props DrewAPicture.
Fixes #30910.

File:
1 edited

Legend:

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

    r31292 r31323  
    11531153
    11541154    // Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published.
    1155     if ( in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
     1155    if ( in_array( $post->post_status, array( 'draft', 'pending', 'future' ) ) ) {
    11561156        $post->post_status = 'publish';
    11571157        $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID);
Note: See TracChangeset for help on using the changeset viewer.