Last active
March 23, 2021 19:46
-
-
Save KaineLabs/3b372c3a1297af8840264d4481259e08 to your computer and use it in GitHub Desktop.
Disable Widgets settings
This file contains 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 | |
/** | |
* Disable Widgets Settings. | |
*/ | |
function yzc_disable_widgets_settings( $is_current_component, $component) { | |
if ( $component =='widgets' ) { | |
return false; | |
} | |
return $is_current_component; | |
} | |
add_filter( 'bp_is_current_component', 'yzc_disable_widgets_settings', 10, 2 ); | |
/** | |
* Remove Widgets Settings from Account Menu. | |
*/ | |
function yzc_remove_widgets_settings_account_menu( $menu ) { | |
unset($menu['widgets'] ); | |
return $menu; | |
} | |
add_filter( 'youzify_account_page_main_menu', 'yzc_remove_widgets_settings_account_menu' ); | |
/** | |
* Remove Widgets Settings from Profile Menu. | |
*/ | |
function yzc_remove_widgets_settings_profile_menu( $menu ) { | |
unset( $menu['widgets'] ); | |
return $menu; | |
} | |
add_filter( 'youzify_get_profile_account_menu', 'yzc_remove_widgets_settings_profile_menu' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment