[wp-trac] [WordPress Trac] #47911: redirect_guess_404_permalink does not consider public custom posts status

WordPress Trac noreply at wordpress.org
Wed Aug 21 09:46:20 UTC 2019


#47911: redirect_guess_404_permalink does not consider public custom posts status
---------------------------+-----------------------------
 Reporter:  goaroundagain  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Canonical      |    Version:  5.2.2
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 At the moment the redirect_guess_404_permalink function does only consider
 the default "publish" post status and there is no way around because
 "publish" ist hard coded:


 {{{$post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE $where
 AND post_status = 'publish'" );}}}

 From register_post_status:
 https://codex.wordpress.org/Function_Reference/register_post_status
 public: (bool) (optional) Whether posts of this status should be shown in
 the front end of the site.

 For this reason, all post with a custom post status set to public will not
 be found and return an 404.

 I think custom post status with public set to true should also be
 considered.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47911>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list