Last active
May 16, 2023 06:06
-
-
Save raftaar1191/f4e4ea7e6443ad729b5fd658c823db03 to your computer and use it in GitHub Desktop.
BuddyPress Print shortcode
This file contains hidden or 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
function BP_theme_child_profile_link( $atts ) { | |
$text = isset( $atts['text'] ) ? $atts['text'] : 'Profile Link'; | |
$profile_link = trailingslashit( bp_loggedin_user_domain() . bp_get_profile_slug() ); | |
$profile_link = trailingslashit( $profile_link . 'change-avatar' ); | |
return sprintf( '<a href="%s">%s</a>', $profile_link, $text ); | |
} | |
add_shortcode( 'BP_profile_link', 'BP_theme_child_profile_link' ); | |
add_filter( 'bp_core_render_message_content', 'do_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment