Created
June 1, 2023 13:57
-
-
Save sybrew/69eea715fd1f59896f4df7f6b1c89565 to your computer and use it in GitHub Desktop.
Hides TSF's admin interface from everyone but the Super Administrator (capability manage_network, or manage_options on non-multisite).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: TSF Headless Mode for non-super-admin. | |
* Plugin URI: https://theseoframework.com/ | |
* Description: Enables Headless Mode for The SEO Framework in the admin area for non-admins. | |
* Version: 1.0.0 | |
* Author: Sybre Waaijer | |
* Author URI: https://theseoframework.com/ | |
* License: GPLv3 | |
*/ | |
add_action( | |
'plugins_loaded', | |
function() { | |
// If on the admin area, and if the user isn't a super admin, hide all SEO settings and prevent overwriting settings: | |
if ( is_admin() && ! is_super_admin() ) | |
define( 'THE_SEO_FRAMEWORK_HEADLESS', true ); | |
}, | |
4 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment