Last active
April 3, 2025 11:47
-
-
Save deckerweb/3498510 to your computer and use it in GitHub Desktop.
Multisite Toolbar Additions -- constants for customizing
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 | |
| // Since plugin version v1.0.0: | |
| // Constants: | |
| /** Multisite Toolbar Additions: Disable Custom Nav Menu for Super Admins */ | |
| define( 'MSTBA_SUPER_ADMIN_NAV_MENU', FALSE ); | |
| /** Multisite Toolbar Additions: Disable Plugin Support for Network Wide Plugins */ | |
| define( 'MSTBA_DISPLAY_NETWORK_EXTEND_GROUP', FALSE ); | |
| /** Multisite Toolbar Additions: Disable Plugin Support for (Sub) Site Specific Plugins */ | |
| define( 'MSTBA_DISPLAY_SITE_EXTEND_GROUP', FALSE ); | |
| /** Multisite Toolbar Additions: Disable Site Specific Items */ | |
| define( 'MSTBA_DISPLAY_SITE_GROUP', FALSE ); | |
| /** Multisite Toolbar Additions: Remove Network Admin specific Items for user ID 2 */ | |
| if ( 2 === get_current_user_id() ) { | |
| define( 'MSTBA_DISPLAY_NETWORK_ITEMS', FALSE ); | |
| } | |
| /** Multisite Toolbar Additions: Remove Network Admin specific Items from frontend */ | |
| if ( ! is_admin() ) { | |
| define( 'MSTBA_DISPLAY_NETWORK_ITEMS', FALSE ); | |
| } | |
| // Since plugin version v1.4.0 | |
| add_filter( 'mstba_filter_super_admin_nav_menu_priority', 'mstba_custom_position_super_admin_nav_menu' ); | |
| /** | |
| * Multisite Toolbar Additions: | |
| * Adjust Super Admin Nav Menu Position | |
| */ | |
| function mstba_custom_position_super_admin_nav_menu() { | |
| return 20; | |
| } | |
| add_filter( 'mstba_filter_network_admin_new_content_priority', 'mstba_custom_position_network_admin_new_content' ); | |
| /** | |
| * Multisite Toolbar Additions: | |
| * Adjust Network Admin "+ New" Position | |
| */ | |
| function mstba_custom_position_network_admin_new_content() { | |
| return 80; | |
| } | |
| /** | |
| * Multisite Toolbar Additions: | |
| * Remove Network Admin "+ New" section | |
| */ | |
| add_filter( 'mstba_filter_display_network_new_content', '__return_false' ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: The above codes work with plugin version v1.0.0 or higher!
Extended explanation can be found at the plugin's page "FAQ" section:
https://github.com/deckerweb/multisite-toolbar-additions#frequently-asked-questions
Download "Multisite Toolbar Additions" plugin at wordpress.org:
https://github.com/deckerweb/multisite-toolbar-additions#installation