mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@31114 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -157,7 +157,7 @@ function get_permalink( $id = 0, $leavename = false ) {
|
||||
*/
|
||||
$permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );
|
||||
|
||||
if ( '' != $permalink && !in_array($post->post_status, array('draft', 'pending', 'auto-draft')) ) {
|
||||
if ( '' != $permalink && !in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {
|
||||
$unixtime = strtotime($post->post_date);
|
||||
|
||||
$category = '';
|
||||
@@ -253,7 +253,7 @@ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
|
||||
|
||||
$slug = $post->post_name;
|
||||
|
||||
$draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
|
||||
$draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) );
|
||||
|
||||
$post_type = get_post_type_object($post->post_type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user