WordPress.org

Ready to get started?Download WordPress

Forums

(advanced) Parsing URI To Get Post ID? (3 posts)

  1. richcon
    Member
    Posted 5 years ago #

    Is there any way to manually figure out which post/page/whatever a particular URI points to?

    I know PHP must do this every time someone connects to the server, but I haven't been able to figure out where or what function to use.

    I spent a while digging through the WordPress source and can't find it. I figured out it must happen somewhere between wp-settings.php (where it starts by fixing IIS url bugs) and wp-query.php (where it sets the flags that say what kind of resource you're looking at). But where exactly I haven't been able to find it.

    Thanks!

  2. richcon
    Member
    Posted 5 years ago #

    I know PHP must do this every time someone connects to the server, but I haven't been able to figure out where or what function to use.

    Er, I mean WordPress, not PHP. :)

  3. richcon
    Member
    Posted 5 years ago #

    I've tracked it down, I think it's WP->parse_request() in classes.php. I'm trying now to figure out how to call it manually without messing up any critical global variables...

Topic Closed

This topic has been closed to new replies.

About this Topic