Ticket #15041: page-auto-draft-fix.2.diff
| File page-auto-draft-fix.2.diff, 806 bytes (added by SergeyBiryukov, 2 years ago) |
|---|
-
wp-includes/link-template.php
185 185 186 186 $slug = $post->post_name; 187 187 188 $draft_or_pending = i n_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );188 $draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) ); 189 189 190 190 $post_type = get_post_type_object($post->post_type); 191 191 192 if ( !empty($post_link) && ( ( isset($post->post_status) && !$draft_or_pending )|| $sample ) ) {192 if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) { 193 193 if ( ! $leavename ) { 194 194 if ( $post_type->hierarchical ) 195 195 $slug = get_page_uri($id);
