I think you just need to add it to the query vars
add_filter( 'query_vars', 'my_query_vars' );
function my_query_vars( $query_vars ) {
$query_vars[] = 'foo';
return $query_vars;
}
Related Posts:
- Why “?v=hash” is added to my URLs? [closed]
- use query string in URL to display content on the page
- Pulling a parameter out of the URL of a WP link without “?” or being sent to a different page
- Dynamically change page title from URL param
- 404 error when passing “cat” parameter to URL
- HTTP 403 Error when passing parameters to URL
- WordPress get parameter ‘unapproved’ and ‘moderation-hash’
- How to parse a custom url (within WP site) and obtain params passed to that URL
- Passing values through url for checkbox fields with same name to get?
- Custom HTML title based on URL parameter
- How to get a page url segment on wordpress?
- Different url to same page (with dynamic content)
- Add a paramter to page url
- Why “?v=hash” is added to my URLs? [closed]
- Add more than one query parameter onto wordpress url
- Set A Cookie To URL Parameter, Pass Cookie From Page To Page To Alter Post
- Add addtional page parameter before loading the page
- Use URL parameter to create dynamic content
- Pass post title as URL parameter
- How to pass parameters thru URL?
- Duplicate pages with ?s parameter
- How to use query string in URL to display content on the wordpress page
- help me remove this additional parameter in url
- Conditional Content Linked to Cookie Value Only Shows on 2nd Page Load
- How do you retrieve a post by slug name through REST API?
- Detecting a WordPress URL without doing a full HTTP GET?
- How does WordPress generate URL slugs?
- How does routing on wordpress work?
- Redirecting to old domain after migration
- Custom plugin route in WordPress
- Why is ?doing_wp_cron being appended to my URLs
- Unwanted media library URLs in posts?
- How to remove file versions from the file source links in wp_head?
- Change default URL path (/blog/) of blog posts
- Difference between esc_url() and esc_url_raw()
- Access the same page from multiple urls (wildcard)
- How to deal with WordPress on localhost
- How to Check if a Page Exists by URL?
- Problem with guids and absolute links
- How to convert the file path to a URL of the same file?
- Add menu and submenu in admin with a URL instead of slug?
- Strategy for handling hierarchical pages with empty parent content
- Update media file url in wordpress media library
- Why is WordPress saving full-urls to the database?
- Removing hierarchical pages in the permalink
- Get taxonomy slug from url
- How to check if feed URL was requested?
- Load images with http urls inside https post
- Remove All Query Arg
- Open WordPress ‘Add New Post’ admin page with parameters set via $_GET
- How to remove /index.php/ from URL’s
- Run WordPress frontend and backend in different domains
- How to set global variable in functions.php
- Force the Website URL to Include “www” and to be Upper Case?
- Why does WordPress automatically redirect URLs with the parameter “name=” to a different page?
- How to remove “http://” When Echoing URL?
- Change logo url link
- WordPress and $_GET Params
- Can’t login after my site was moved to a new server
- How to Remove Slug From Database?
- WPML Get url without outputting
- How to inject custom url path for page ?
- List of default WordPress URLs
- Why WP encodes UNICODE (UTF8) containing urls? Any drawbacks of UNICODE url?
- Adding a hook to ‘parse_request’ so that siteurl/pagename/xyz ignores “xyz”
- How to have numeric URLs in Posts and Pages
- Unable to load static front page on home url
- Force home page to be https?
- Why WordPress automatically removes http from the url of my website’s sub domain?
- add_query_arg() One Key with multiple values
- How to Add Pages Under Custom Post Type URL Structure?
- Weird: /?name in URL leads to blog
- I am Looking to append URL Parameter to all URLs
- How do I amend the fixed “author” part in the URL?
- WordPress Move to SSL How to Update Media Assets to HTTPS?
- Dynamic URL generates dynamic content
- Moving wp-content outside of web root?
- Pages redirected to attachment post
- Generate one time URL
- In Settings>>General I am missing some fields
- Change homepage url
- How to change page URLs to “www.site.com/page” instead of “example.com/blog/page” but keep post URLs as “example.com/blog/post”?
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- As soon as I add a custom query_var using the filter, my pages point to an archive page – why?
- Is dynamic URL possible in WordPress
- Page with the same name of a category
- Adding target and _blank as it’s value to the allowedtags
- How to update media links in WordPress after migration?
- permalink for category pages and posts
- Accessing the Current URL in a Text Widget for a Facebook Share Button?
- Is ‘name’ a reserved word in URL’s?
- get_site_url is not returning anything?
- Check what is at URI (post, archive, etc…)
- Get url from file uploaded in Media Library
- How to create a custom page base on URL for WordPress?
- How to make menu items active based on hash
- Use image url with add_image_size
- Multiple domain names for one site
- How to change URL Custom Page?
- How to always rewrite author archive page URL even if the author does not have a post