Make WordPress Core


Ignore:
Timestamp:
10/17/2015 12:43:54 AM (10 years ago)
Author:
jorbin
Message:

Improve get_post_permalink compatibility with non standard post status

This adds a new filter named get_post_status to the function named get_post_status which can be used to make additional post types behave like unpublished post status in get_post_permalink.

Props misterbisson, antpb, iamfriendly
Fixes #23458

File:
1 edited

Legend:

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

    r35170 r35233  
    260260    $slug = $post->post_name;
    261261
    262     $draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) );
     262    $draft_or_pending = get_post_status( $id ) && in_array( get_post_status( $id ), array( 'draft', 'pending', 'auto-draft', 'future' ) );
    263263
    264264    $post_type = get_post_type_object($post->post_type);
Note: See TracChangeset for help on using the changeset viewer.