I just wrote a little plugin that detects if the user is on a mobile browser and if so detects them away from the WordPress site to a mobile (simple) version of part of the site.
As I got to thinking I’m redirecting user who may want to see the full site. I can easily add a check by creating a URL such as http://example.org?force_web=true
The only problem is my plugin checks the top of each page to see if it’s mobile so I would need to set force_web=true
on all pages.
The other idea would be to use sessions but it seems WordPress doesn’t support sessions unless you add session_start();
to your wp_config.php
file which I don’t want to ask the plugin users to do.
Is this something others have experienced? Is the best way to re-write all permalinks with the addition of my variable?
Open to ideas and suggestions
As Ambitious Amoeba said, just do the check on each page load; it shouldn’t be that expensive.
Otherwise, another possibility to store a single bit of information would be to use browser cookies.