I have create a custom url for my plugin in WordPress that I don’t like to have any argument.
Lets say that my URL us that
How can I know from my code that the users in on /test/ and not in any other page from within my code ?
This is my code:
add_action('init', 'add_rewrite_rule');
function add_rewrite_rule()
{
add_rewrite_rule('test/?', 'index.php', 'top');
}
if you only want to test whether the current pages ends with /test/, can you do it in php like this:
This is not test, but worth trying.