Display All WP Query Variables in WordPress

How to Display All WP Query Variables in WordPress

in Functions
Google+ LinkedIn

When developing a WordPress theme or plugin, it may be very useful to be able to output all WP Query variables. Here is a simple code snippet to do it easily.

Paste the code below on any files, where you’d like to display the WP Query variables.

<?php
    // display all wp query variables
    global $wp_query;
    var_dump( $wp_query->query_vars );
?>

Share the love

If you like this snippet, share it with others!

Leave a Reply

Your email address will not be published. Required fields are marked *