Last active
October 10, 2018 14:34
-
-
Save KaineLabs/eb7adc96b644f68dfc7494ff7ded3563 to your computer and use it in GitHub Desktop.
Set Xprofile widgets edit url
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 | |
/** | |
* Set Xprofile widgets edit url. | |
*/ | |
function yz_set_xprofile_widgets_settings_edit_url( $edit_url, $widget_name ) { | |
if ( ! bp_is_active( 'xprofile' ) ) { | |
return $edit_url; | |
} | |
if ( 'custom_infos' == $widget_name ) { | |
$group_id = bp_get_the_profile_group_id(); | |
return yz_get_profile_settings_url( 'edit/group/' . $group_id ); | |
} | |
return $edit_url; | |
} | |
add_filter( 'yz_profile_widgets_edit_link' , 'yz_set_xprofile_widgets_settings_edit_url', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment