The simplest and quickest solution would be to use the add_rewrite_endpoint
function.
<?php add_rewrite_endpoint( $name, $places ); ?>
So in your case it would be something like this:
add_rewrite_endpoint( 'user', EP_PERMALINK | EP_PAGES );
An user URL would look like this:
http://www.example.com/my-page/user/john
To access the variable:
$user = get_query_var( 'user', false );
Related Posts:
- Best way to hook a custom url?
- Redirect to another page using contact form 7? [closed]
- Trying to Find the PHP File/Function that Handles a Specific Form Action URL
- How to add a shortcode button to the TinyMCE editor?
- Custom pages with plugin
- Custom media upload content for inserting custom post shortcode
- Checking if an attribute exists in a shortcode
- Add rewrite rule to permalink structure
- enqueue script only if it is not already enqueue
- add_rewrite_rule, plugin activation and plugin deactivation
- Which method is best to enqueue scripts
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- What is the best way to output plugin result in certain url
- How To Ignore a Filter On Applying Filter the Content In a Function
- Shortcode display outside the div
- Pass $this to function nested in another public function of the same class
- Woocommerce different URL for every table placed in the restaurant
- Author Specific URL’s in WordPress
- shortcode doesn’t work
- Does flush_rewrite_rules() remove all rules added by other plugins as well as mine?
- Add_rewrite_rule doesn’t add custom url in plugin
- How to add inline css/js inside a shortcode
- flush_rewrite_rules() not working on plugin activation
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- custom taxonomy and custom post type url conflict
- Find the URL of the current plugin directory
- Rewrite url without flushing the database?
- Demystifying and understanding shortcode nomenclature
- How to Create a Custom Plugin Permalink
- Any Short code Availble for Get Post List With Thumbnail Plugin?
- Where to call add_shortcode function in WordPress Plugin Boilerplate?
- Input with spaces in Shortcode attributes overwritten by defaults
- Allow users of my plugin to define their own shortcode rather than use mine?
- Making a Template for a CPT created by a plugin
- creating html reusable blocks via shortcodes
- Single API call exposed via shortcode with params
- Creating shortcodes in plugin
- How to create a custom shortcode based on the layout?
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Create shortcode to echo javascript
- Namespaced shortcode?
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Why am I unable to load scripts in head in plugin?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- IF condition based on wp_remote_get output
- Shortcode Attributes to Return different $_POST
- How to use template inside plugin shortcode with variables for big HTML code
- strange shortcode error: does shortcodes requires any dependency?
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- How to embed a new string in url?
- Change language on website and change currency with url query
- Thumbnail image doesn’t show up in Shortcode output
- list of custom post by custom field in frontend
- insert og image link in wordpress post
- Shortcode do not return the right data in post
- How to call function in WordPress on button click?
- Hide content for specific users with id
- Why is my shortcode not working?
- WordPress rewrite rule depend on meta values not ids
- WordPress drop domain alias
- WP Plugin CSS not being applied to page
- Modify Plugin PHP Class in Child Theme – Correct Method
- Change default url to plugin custom post type
- Custom pages with plugin
- Shortcode in a blog post, footer and related products stop working
- shortcode which is introduced into entry the blog, and appears in side bar
- Creating custom URL for async content
- URL RewriteRule doesn’t work when using WP Database Participants in my WordPress website
- Custom shortcode with dynamic rewrite
- How To Rewrite WordPress Pages URL Only?
- Why function hooked using object are executing at all time?
- Apache rewrite rules and wordpress problem
- Shortcode registered from a plugin not recognized
- How can I process all requests for a given directory in a URL with my plugin?
- How to get the real address from a url (permalink)
- Remove base from the custom post type URL [duplicate]
- WP Job Manger change jobs url (NOT slug)
- map urls to plugins
- HTML link within my plugin settings page
- Any way to hook into WP after a page displays?
- How to create a custom wordpress plugin for a specific functionality?
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Display file contents within Plugin
- How to get next day date of a specific day
- Custom Plugin not Displaying in the Website Production environment (Divi)
- Shortcode not working – quotes seems strange
- DB Query not working in Plugin
- Get all the URLs of the pages that uses a specific shortcode
- Why is my WordPress Plugin page requesting my FTP Login Credentials?
- add seperate suffix for low price and high price in woocommerce
- URL rewrite with external JSON query
- Cross Sells are not being shown in Cart Page. Please Help!
- Error with get_price (and others) in self-written plugin to show price
- WordPress Fatal Errors [closed]
- Minimize and Uglify WordPress Plugin Files
- YOAST Seo xmlsitemap menu item not showing in the dashboard [closed]
- Change the number of plugins counted on wp-admin/plugins.php
- Translation issue with global variables
- plugin uninstall function drop the tables, but shows errors on admin
- Get param from shortcode in plugin function