Is there any way that WordPress always keeps a custom parameter in every link it generates? Here’s what I want to do.
I want to create a debug mode by entering ?debug
as a URL parameter; and display some specific information or do some debug only coding if that URL parameter is available. I know what I need to get WP to work with custom URL parameters. I want to know how can I make WP to keep debug
parameter in all the liks it generates; and this parameter keeps propagating to all the links I click on while navigating the entire site until I remove it.
You should not change the output you want to debug just to debug it, thatâs a contradiction. 🙂
Use cookies for that. For example, put something like this into your
wp-config.php
:Now add
?debug=on
to any URL, and all following requests will use the debug mode. Add?debug=off
to delete the cookie and to turn debug mode off.