Add url_to_postid filter. Props Alex King. fixes #4160
git-svn-id: https://develop.svn.wordpress.org/trunk@5283 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b749fb0711
commit
e2094a4e19
|
@ -63,6 +63,8 @@ function add_rewrite_endpoint($name, $places) {
|
|||
// determine the post ID it represents.
|
||||
function url_to_postid($url) {
|
||||
global $wp_rewrite;
|
||||
|
||||
$url = apply_filters('url_to_postid', $url);
|
||||
|
||||
// First, check to see if there is a 'p=N' or 'page_id=N' to match against
|
||||
preg_match('#[?&](p|page_id)=(\d+)#', $url, $values);
|
||||
|
|
Loading…
Reference in New Issue