Make WordPress Core


Ignore:
Timestamp:
01/09/2015 04:39:56 PM (10 years ago)
Author:
boonebgorges
Message:

In get_permalink(), don't resolve to pretty permalink if post has 'future' status.

We already do this for other non-public statuses, to prevent leaking non-public
information about unpublished posts.

Props e.mazovetskiy, CalEvans.
Fixes #30910.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r31107 r31114  
    158158    $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );
    159159
    160     if ( '' != $permalink && !in_array($post->post_status, array('draft', 'pending', 'auto-draft')) ) {
     160    if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {
    161161        $unixtime = strtotime($post->post_date);
    162162
     
    254254    $slug = $post->post_name;
    255255
    256     $draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
     256    $draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) );
    257257
    258258    $post_type = get_post_type_object($post->post_type);
Note: See TracChangeset for help on using the changeset viewer.