Have a look at the Action Reference to see generally how requests are processed. After all the loading and init stuff happens, the parse_request
action runs when the request is matched against the rewrite rules, and an object is passed containing all the registered query vars and the matched rule and query string.
function wpd_parse_request( $request ){
echo $request->matched_query;
}
add_action( 'parse_request', 'wpd_parse_request' );
After the wp
action runs, that same object is stashed in the wp
global.
global $wp;
echo $wp->matched_query;
Related Posts:
- How to stop wordpress to make the default query?
- Query two taxonomies via URL or link?
- Multiple endpoints in one URL
- Can not switch the queried post in pre_get_posts hook
- Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?
- Difficulty with rewrite rules
- remove query arg from url after set query
- WordPress add_rewrite_rule() cannot visit lower url levels
- Serve specific “template” page at any URL that ends in its slug
- How to figure out redirection and contents in hybrid solution containing word press content and legacy code (ASP.net)
- How to use if($wp_query->query_vars[‘name’] == ‘pagethatdontexist’) without getting a 404? How to suppress 404
- WordPress rewrite with custom parameter doesn’t work
- How to allow a variable with “/” in wordpress url
- How can I re-query post_type and rewrite the url?
- Rewrite rule pagination on different url levels
- How to list posts of a given format
- Pagination on custom post type not working
- Wp_redirect and sending variables
- How do I get posts that have a thumbnail in WP_Query?
- Multiple WP_Query loops with Pagination
- WP_Query with checkbox meta_query
- IP address character limit
- What is the most efficient way of querying posts based on visits and date for current day?
- How to add custom query filters in WP_User_Query
- How to order category.php loop by ‘meta_value’?
- Searching user meta using WP_User_Query
- Which custom query am I in and how can I access its properties & methods?
- Does using a custom query_var create a security hole?
- Filter WordPress posts by between parameter
- 2 loops on page – one with orderby rand second orderby date
- Undefined WP_Query::has_posts()?
- WP_Query returning no results
- Splice together 2 WP_Query objects
- How to access a query twice in different template files?
- Complex Category selection as per user input
- How to set multiple `orderby` in query argument?
- WP_Query posts_per_page Only Bringing Back one post
- How to get all unique categories for posts in loop?
- Query that loads a custom type AND posts whose ids are not inside those custom types custom fields
- Get and Trim Full Post Content in WP Query
- Transient not behaving as expected
- how can I override The Events Calendar query modifications?
- the_post() within switch_to_blog() altering my excerpt
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- WP_Query post_parent parameter always returns children of current page
- Query about wp_query
- wp_query sort with meta_value_num is not working
- empty WP_Query object on local install
- Query posts only without featured image
- How to use WP_Query() on single.php?
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- Loop increase in while loop not working
- Get All posts by Tag_Id not working, query seems to contain extra term_taxonomy_id
- Is this meta query problematic?
- Appending to existing WP_Query’s meta_query if exists
- Yoast primary category query modification
- Excluding posts with certain value of meta_key keeping posts without that meta_key
- Filter out a meta key in the Search results page with two CPT
- Function using get_posts() with tax_query not working when called from functions.php
- Include one page/post into query which is already returning posts
- Search for pages with permalink
- Don’t repeat posts from children in parent taxonomy query
- How to add a recent post function to a text widget I created for practice?
- Can I make a search query which includes a space?
- Help with if statement inside while loop
- wp-query problem with author
- WP_Query – display posts by custom field and order by another
- Custom WP Query order function possible?
- Pagination unique to a widget
- Ascending numerical sorting with non-numerical characters last
- Is the ‘parse_query’ filter still valid to change filtered content on admin list view?
- I removed the “wp_rm_logs” table and am constantly getting this error
- How to set selected attribute on option after filter query?
- custom search form, posts_per_page value being ignored
- WP_Query returns empty if meta_query has more than 7 values
- Fetching $_POST from Page Template into functions.php
- query.php – multiple is_category functions
- Custom query with post_class filter using current_post not working
- Overwriting auto-appended NOT IN query in WP_Query
- posts_per_page not returning correct number of posts
- Conditionals in WP_Query
- Why WP_Query in functions.php is not working when get_posts works?
- Next / previous posts link doesn’t show up with Posts 2 Posts
- Loop the posts between two dates selected using jquery datepicker
- Passing conditional arrays to WP_Query() [closed]
- query by meta value then date and not empty meta value
- Issue with sorting by post date and custom post type
- wordpress sorting using array merge by price in ascending order but price with 0 must be show last
- Carousel Loop only duplicating
- Remove divs and spans from post content
- Can’t get LIKE to work with wp_query [closed]
- Get all user with both meta_value
- I want to capture the last day’s (today) posts in a category in the numbered order in acf
- How do I have multiple metaqueries inside one wordpress query
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- Why am I getting no results of a query placed after another query?
- Can I use WP_Query to find a post with a particular menu_order?
- Display only posts with thumbnails
- How to efficiently find “duplicate” posts, where the titles are different, using metadata to match posts?