[wp-trac] [WordPress Trac] #40836: add_rewrite_endpoint() creates sub directories after endpoint

WordPress Trac noreply at wordpress.org
Mon May 22 13:00:09 UTC 2017


#40836: add_rewrite_endpoint() creates sub directories after endpoint
---------------------------+-----------------------------
 Reporter:  henry.wright   |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Rewrite Rules  |    Version:
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Adding an endpoint with {{{add_rewrite_endpoint()}}} seems to also create
 sub directories after that endpoint. For example:

 {{{
 // Add query var.
 add_filter( 'query_vars', function( $vars ) {
     $vars[] = 'my-endpoint';
     return $vars;
 } );

 // Add endpoint.
 add_action( 'init', function() {
     add_rewrite_endpoint( 'my-endpoint', EP_AUTHORS );
 } );
 }}}

 I can now visit:

  - example.com/author/my-endpoint
  - example.com/author/my-endpoint/random
  - example.com/author/my-endpoint/anything-here

 Is this expected?

 I believe the following should return a 404:

  - example.com/author/my-endpoint/random
  - example.com/author/my-endpoint/anything-here

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


More information about the wp-trac mailing list