The MU forums have moved to WordPress.org

Detecting page ID before wp_query, wp_redirect are set (4 posts)

  1. mslade
    Member
    Posted 15 years ago #

    Hello all. I'm working on a plugin that due to its nature must do meta lookups on a post_id before wp_query and wp_redirect are instantiated by WPMU. I'm using pretty URLs on my blog, such as:

    http://blogs.example.com/blog_name/path/to/page/

    Can anyone offer me advice on the best way to get the post_id of the requested URL? Is it possible without messing up the rest of the request?

    Thanks,
    Mark

  2. mslade
    Member
    Posted 15 years ago #

    Bump -- can anybody point me in the right direction?

  3. phlux0r
    Member
    Posted 15 years ago #

    Would maybe get_page_by_path() help you?

  4. mslade
    Member
    Posted 15 years ago #

    That did the job nicely; thank you.

About this Topic