Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active October 10, 2018 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/eb7adc96b644f68dfc7494ff7ded3563 to your computer and use it in GitHub Desktop.
Save KaineLabs/eb7adc96b644f68dfc7494ff7ded3563 to your computer and use it in GitHub Desktop.
Set Xprofile widgets edit url
<?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