first, you should use the proper filter and method to add query vars and rewrite rules and not manipulate the globals directly. the other issue I believe is your regex pattern, this is working for me:
add_filter( 'query_vars', 'wpa59404_query_vars' );
function wpa59404_query_vars($query_vars){
$query_vars[] = 'update_slug';
return $query_vars;
}
add_action( 'init', 'wpa59404_rewrites' );
function wpa59404_rewrites(){
add_rewrite_rule(
'updates/plugins/([^/]+)/?$',
'index.php?update_slug=$matches[1]',
'top'
);
}
Related Posts:
- How can I hide that I Use WordPress (with W3 Total Cache)
- How to get WordPress Adminmenu items?
- admin-ajax.php responding with 0
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Making Quote Plugin more efficient
- How to access function from outside of a class within this class in WP plugin?
- Escape when echoed
- Scope for PHP Variables Assigned in functions.php or a plugin
- Hiding WordPress Plugin Source Code
- How can i display post loop in table format?
- Plugin exceeds memory limit
- Page Reloads Before AJAX Request Finishes
- action hook wp_head higher priority as all other plugins/hooks
- WP_cron won’t trigger my action
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- PHP can I add line numbers to file_get_contents()
- Add htaccess rules with insert_with_markers at beginning of htaccess
- custom shortcode will not display the wrapped content
- Write to / remove from default .htaccess file from plugin?
- How to call function at the bottom of post using plugin?
- Update Option Error: Notice: Undefined index
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Insert array data on plugin activation
- Will simple function names in a class structure conflict with other plugins?
- Do my defines need to be unique?
- Plugin Development sqlite or WordPress’ database
- WordPress php filter admin_body_class not working
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Instantiate class to be available to all plugin functions
- Common abstract class for plugins
- How to trigger $_GET request within admin plugin page?
- How to create a custom category of wordpress admin
- Adding a div at the bottom of a sidebar
- How to generate video out of images via WordPress plugin
- How can I get WordPress to save comments in markdown format?
- How to run JS, PHP and etc. inside WP post?
- WooCommerce get_price returning wrong price when used via ajax
- How to test nonce with AJAX – Plugin development
- What does $wpdb->get_row return?
- How to ‘clone’ a wp plugin to make small changes
- Open Post Thumbnail in New Child Theme File in WordPress
- Where should I save an API key of my user when installing my plugin?
- WP add_action factory
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Programatically download a plugin
- wp_loaded hook block script enquequing
- WP nonce invalid
- Redirecting to home page after login as custom role WordPress
- Add keywords meta to index.php page
- woocommerce subscriptions – get expiration date [closed]
- Custom form action to handle data inside a plugin
- Same log message keeps on printing to debug.log file thousand of times
- Self deactivate plugins after an action occurs
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Adding Default Settings to Theme My Login plugin
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- Plugin CSS not enqueing
- Create onClick Event to Re-load a Widget
- Swapping wp_dropdown_categories function with wp_category_checklist
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- WP Post Template – Templates in own folder
- How to access global variable $menu inside a class function
- Avoid class name collision when using third party libraries in plugins?
- wordpress plugin is not activating from widget
- Edit Yoast SEO breadcrumbs output [closed]
- How would I go about creating a user ranked post popularity page?
- Working with wordpress plugin and theme templates structures
- WordPress: Access a plugin from within a theme
- WordPress plugin/code to hide all things related of a user from the public
- Hide categories that are not used in the post type
- Automated Cart Update With Alert Box Each Time
- How can I remove a function that has been added to wordpress with add_filter?
- Redirection of users away from wp-admin (but not administrators)
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Using a custom plugin to capture input data via Ajax and PHP
- How to sanitize any integer input field in wordpress?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- WordPress ajax doesn’t display object method on jQuery .change() function
- Custom user login page by creating a plugin
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- code is working properly in Core PHP but writing coding in WordPress
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- what is the best practice to add new field to an api route
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]