[wp-trac] [WordPress Trac] #31140: WordPress 4.0 upgrade caused 404 on single custom post types

WordPress Trac noreply at wordpress.org
Mon Jan 26 23:15:54 UTC 2015


#31140: WordPress 4.0 upgrade caused 404 on single custom post types
-------------------------------+------------------------------
 Reporter:  MarjWyatt          |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  4.0
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by MarjWyatt):

 I see that I added the code incorrectly and didn't supply keywords.
 Sorry.

 Here is the code/function:

 {{{
 // Manually protest wsg-intros because WLM doesn't
 add_action( 'pre_get_posts', 'protect_wsg_intros' );
 function protect_wsg_intros() {
     if ( ( is_post_type_archive ( 'wsg-intros' ) ) && ( !
 is_user_logged_in() ) ) {
         wp_redirect( 'http://localhost/wsg/oops-this-content-is-members-
 only' );
     }
     elseif ( ( is_singular ( 'wsg-intros' ) ) && ( ! is_user_logged_in() )
 ) {
         wp_redirect( 'http://localhost/wsg/oops-this-content-is-members-
 only' );
     }
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31140#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list