Conditionally load public and admin code with AJAX working on both sides

I managed to resolve this issue by also checking for public interface. I created new function isPublic() to check if it is public. So here is my final code: if ($this->isPublic()) { require_once(plugin_dir_path(dirname(__FILE__)) . ‘public/class-public.php’); $this->Public = new Public(); } elseif ($this->isAdmin()) { require_once(plugin_dir_path(dirname(__FILE__)) . ‘admin/class-admin.php’); $this->Admin = new Admin(); } and here are helper … Read more

Remove metatag from a particular page

That would be: <php if (!is_page(‘slug-of-your-page’)) echo ‘<meta name=”viewport” content=”width=device-width, initial-scale=1″ />’ ?> Beware that if you change the theme files, your changes will be lost if the theme gets updated.

Allow editor user to full permission to access plugin settings

This is a problem with the original plugin. They obviously never actually tested this filter. They have used the mc4wp_admin_required_capability to control whether the admin page is accessible, but WordPress still prevents you saving settings unless this filter is also used: https://developer.wordpress.org/reference/hooks/option_page_capability_option_page You should contact the plugin author and ask them to fix this, but … Read more