[wp-trac] [WordPress Trac] #38041: Rewrite rules on custom post types not detected ( url_to_postid() )

WordPress Trac noreply at wordpress.org
Tue Sep 13 13:58:15 UTC 2016


#38041: Rewrite rules on custom post types not detected ( url_to_postid() )
---------------------------+-----------------------------
 Reporter:  j0hj0h         |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Rewrite Rules  |    Version:  4.6.1
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 See also: http://wordpress.stackexchange.com/questions/239081/retrieve-
 post-id-from-querying-url

 When using the [https://wordpress.org/plugins/live-composer-page-builder/
 Live Composer Plugin] with its costum post types such as "Projects" (slug:
 `dslc_projects`) the permalink format
 `http://localhost/wordpress/?dslc_projects=testproject` is not processed
 properly by `url_to_postid()`. Note that all other permalink formats,
 except the plain one as above, work fine.
 Live Composer only seems to [https://plugins.trac.wordpress.org/browser
 /live-composer-page-builder/trunk/modules/projects/functions.php#L56
 register new post types] but uses the rewrite function while registering
 them.
 While testing the above URL format I found out that `url_to_postid()`
 exits on [https://core.trac.wordpress.org/browser/tags/4.6/src/wp-
 includes/rewrite.php#L509 the if clause at line 513].

 Apparently the rewrite on the custom post type was not detected.

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


More information about the wp-trac mailing list