Plugin to Add to query_vars Stopped Working
-
Hi Folks,
I’m searching this forum and not getting anywhere. This plugin no longer functions as it should. The code is slightly sanitized to remove the name of my customer, but other than that, this is the plugin I’m using:
An example URL would be https://customer.site.dev/acceptance/?req_info=ZZZZZ
The req_info query_var is no longer passed to $wp_query->query_vars in the acceptance page.
<?php /** * @package CUSTOMER Filters * @version 1.0 */ /* Plugin Name: CUSTOMER Filters Plugin URI: https://www.ieworks.net Description: Custom plugin to add URL filters to CUSTOMER web site Author: Darren Ellis Version: 1.0 Author URI: https://www.ieworks.net */ function customer_filters( $public_query_vars ) { $public_query_vars[] = 'req_info'; return $public_query_vars; } add_filter('query_vars', 'customer_filters'); ?>
I think this broke when I upgraded to 4.4.2, but I didn’t test this after the upgrade, so I am not exactly sure when it broke.
I’ve searched this forum and found lots of examples that would indicate that my code is good.
I’ve tested on TwentyFifteen and gotten the same results: No req_info in query_vars.
php56w-5.6.19-1.w7.x86_64
nginx version: nginx/1.8.1Did something in 4.4* change the way plugins work?
Did something in 4.4* change the way add_filter works?Anyway, I’d appreciate any assistance. Thanks so much!
Darren
- The topic ‘Plugin to Add to query_vars Stopped Working’ is closed to new replies.