Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/511f09e945c11d19f6d06d39f0ea106c to your computer and use it in GitHub Desktop.
Save KaineLabs/511f09e945c11d19f6d06d39f0ea106c to your computer and use it in GitHub Desktop.
Remove Profile Widget For Porfile Owner
<?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