Make url_to_postid() work for custom post type URLs. Use get_post_types() and get_taxonomies() instead of directly accessing globals. Adds unit test.

Props faishal, for the globals fix.
Fixes #19744.



git-svn-id: https://develop.svn.wordpress.org/trunk@25659 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2013-10-02 19:41:19 +00:00
parent 64d3d53838
commit 7918d5cd98
4 changed files with 30 additions and 7 deletions

View File

@@ -1735,7 +1735,7 @@ class WP_Query {
);
}
foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) {
foreach ( get_taxonomies( array() , 'objects' ) as $taxonomy => $t ) {
if ( 'post_tag' == $taxonomy )
continue; // Handled further down in the $q['tag'] block