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]
- 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
- Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?
- Function to activate WordPress theme inside a plugin
- What is the correct way to check if WP_Filesystem can write to a directory without aking for username / password?
- Built in admin ajax hooks?
- Could someone please help me to add category id with in this query so this will return posts from a certain category?
- building plugin and it is displaying above plugins page
- plugin development: problem with functions
- Added slug after URL permalink last slash returns different content
- How do I make a secure API call from a shortcode when a button is clicked?
- Modify page title and subtitle with a plugin
- wp_options not returning value for logged out users?
- Gutenberg default attributes are empty when accessing in edit
- Hide all Admin Notices and move on a separate page
- Make the product page as homepage WooCommerce
- WordPress plugin changes not updating
- wp_update_post call really slow when official Facebook plugin is installed
- How to make content as required in custom post type?
- How to create a “Most Popular” & “Latest” TAB in WordPress