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?
- Should I use spl_autoload_register() in my plugin?
- How can I save a multiple select array with the settings API for a plug-in options page?
- Using register_activation_hook in classes
- Is there a way for a plugin to add an attribute to the tag of a theme?
- How to use update and delete query in wordpress
- Woocommerce -How to set product regular price default
- add_meta_boxes action with refresh on save
- Bulk Image upload and one image for each post?
- Resize Image without cropping
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- When is is_admin() available?
- How to append element after thumbnail
- Scope for PHP Variables Assigned in functions.php or a plugin
- Hiding WordPress Plugin Source Code
- wp_loaded hook block script enquequing
- Custom filter in admin edit custom post type responding with invalid post type?
- How to find error in my code when the error message is pointing to WP core file?
- How to access global variable $menu inside a class function
- wordpress plugin is not activating from widget
- Working with wordpress plugin and theme templates structures
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Custom user login page by creating a plugin
- Singelton class does not work, multiple initialization on page reload
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- How to upload a file to a folder named after the user_id via plugin
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- adjust section according to country?
- How to replace WordPress Media Upload Window with user’s device window?
- Woocommerce Show Single Product on Homepage
- Setup wp_schedule_event within a custom plugin
- WordPress add_rewrite_rules for custom URLs ending in .html
- What exactly do this function declared into functions.php file of a WP theme?
- How to use html inside a functions.php code?
- WordPress Environment: Dynamic Page using shortcode – how to change the page name for sharing
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- execute function after one completed
- plugin add action hook is not working :
- zip unzip attachments in wordpress
- Should i use the wordpress Options table or to create database table..?
- wordpress admin plugin menu custom css
- Integrating boxtal PHP library into a custom WordPress Plugin
- Cant register rest routs from class instance
- how to Update 15k products on plugin activation with meta_option
- Hooks for post saving make a post-new.php to load latest post’s data
- Why is it important to check for isset and is_array before checking in_array in this example?
- Adding Additional Variables on Menus Page
- How to call external functions from a PHP script in a WordPress plugin?
- Using flickr api in custom wordpress plugin
- Toolbar Hidden in a Virtual Page
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- How to add custom function to pluggable.php
- How to displaying Custom image, text and default image logo from Redux Framework option panel
- PHP: $_SESSION destroyed after page reload for my custom session
- How to correctly escape an echo
- Is it possible to access admin-ajax.php using PHP?
- Payment field disappears on custom Paypal plugin
- save_post_product action not firing
- How to get the custom field value using SQL query
- Adding image upload in tag section – WordPress plugin development
- How to Remove Theme Style CSS inside Custom Plugin?
- Creating plugin with front-end pages
- How to Send Pingbacks for all Posts in WordPress?
- I am having errors with checkout on wordpress
- How use wp_insert_post and add og:custom tags?
- How to change “Read More” text?
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Using id to show item
- 400 bad request admin-ajax file upload
- get Woocommerce product format json for WP_Query
- Update user meta when an external link in admin notice is clicked
- Is there an option to execute javascript file only on plugin activation
- How do I remove an action hook inside a class that is called by another class?
- Generate and send ICS file through WordPress
- Is admin section completely customizable in terms of styling?
- The plugin generated 225 characters of unexpected output during activation
- Ajax in a class instantiated via shortcode
- Parsing webhook from Shopify in WordPress
- Shortcode Works for Logged in Users but Not Working for Guest
- Submit to itself don’t work
- WordPress / PhpStorm / XDebug and plugin_dir_path issues
- Send data from plugin to external database
- Creating a user ‘add custom field’ section
- See output of a sql query while plugin installation in wordpress
- Why this plugin is not working?
- Permission error on plugin save
- Doing action based on input from options menu
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- How can I list only Subcategories in Woocommerce
- base64_encode conflict with convert_smilies in wordpress
- Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?
- Login user into magento using wordpress account
- Customize create table SQL statement in any WordPress plugin
- wp_register_script – illegal string offset
- Accessing Correct Database to Create REST API Endpoint