Plugin dont Work Inside AJAX Call

All AJAX calls in WordPress run through admin. So if you wrap something inside if ( ! is_admin() ) { // stuff } then the AJAX call would not be able to know about this part. In other words, it does not get executed. I don’t know what this plugin specifically does, but if only … Read more

Restrict ability to edit pages by username

I striked for something a bit more complex, but similar in the core. The rather old-ish Role Scoper can do that, or you try the Premium version of its successor Press Permit. I befind both a bit complex if you only need a single usage option (manage page restrictions), but they work ;). Hope this … Read more

Redirect loop when forwarding to mobile site

You need to check that you aren’t already on the mobile site: function redirecting_to_mobile_site() { if ( $_SERVER[‘SERVER_NAME’] !== ‘m.example.com’ && wp_is_mobile() ) { wp_redirect( ‘http://m.example.com’ . $_SERVER[‘REQUEST_URI’], 301 ); exit; } } add_action( ‘template_redirect’, ‘redirecting_to_mobile_site’ ); You’ll need to clear your browser cache to properly test the fix.