Created
April 26, 2019 17:38
-
-
Save KaineLabs/511f09e945c11d19f6d06d39f0ea106c to your computer and use it in GitHub Desktop.
Remove Profile Widget For Porfile Owner
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 | |
/** | |
* Remove Profile Widget For Porfile Owner. | |
*/ | |
function yzc_remove_profile_widget_for_profile_owner( $sidebar_widgets ) { | |
if ( bp_is_my_profile() ) { | |
foreach ( $sidebar_widgets as $key => $widget ) { | |
if ( isset( $widget['yz_custom_widget_16'] ) ) { | |
unset( $sidebar_widgets[ $key ]['yz_custom_widget_16'] ); | |
} | |
} | |
} | |
return $sidebar_widgets; | |
} | |
add_filter( 'yz_profile_sidebar_widgets', 'yzc_remove_profile_widget_for_profile_owner' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment