buddypress-group-email-subscription
buddypress-group-email-subscription copied to clipboard
Way to customize links on footer?
Is there a way to customize the links on the footer?
Looking to customize the Text of these links.
Thanks.
See the function ass_bp_email_footer_html_unsubscribe_links()
. We generate the links dynamically, so you'll have to unhook this filter and introduce your own that does something similar. @r-a-y Am I understanding this correctly?
See the function
ass_bp_email_footer_html_unsubscribe_links()
. We generate the links dynamically, so you'll have to unhook this filter and introduce your own that does something similar. @r-a-y Am I understanding this correctly?
Sorry. I didn't see this message until just now. Yes, that's correct.
To unhook the default footer links and roll your own, use the following:
add_action( 'bp_ges_before_bp_send_email', function() {
// unhooks default GES email footer
remove_action( 'bp_after_email_footer', 'ass_bp_email_footer_html_unsubscribe_links' );
// add our custom email footer
add_action( 'bp_after_email_footer', 'my_custom_email_footer' );
} );
function my_custom_email_footer() {
$tokens = buddypress()->ges_tokens;
// Bail if this isn't a group subscription email.
if ( ! isset( $tokens['subscription_type'] ) ) {
return;
}
// do your custom footer routine here.
// to determine what type of email this is use: $tokens['subscription_type']
}
If you're just looking to customize the text, you should look into using a custom localization file (.pot file) or use the 'gettext'
filter to change the strings.