Skip to:
Content

BuddyPress.org

Ticket #7431: 7431.01.patch

File 7431.01.patch, 1.7 KB (added by thebrandonallen, 3 years ago)
  • src/bp-core/bp-core-functions.php

     
    36683668 * @since 2.7.0
    36693669 */
    36703670function bp_email_unsubscribe_handler() {
    3671         $emails         = bp_email_get_type_schema( 'all' );
     3671        $emails         = bp_email_get_unsubscribe_type_schema();
    36723672        $raw_email_type = ! empty( $_GET['nt'] ) ? $_GET['nt'] : '';
    36733673        $raw_hash       = ! empty( $_GET['nh'] ) ? $_GET['nh'] : '';
    36743674        $raw_user_id    = ! empty( $_GET['uid'] ) ? absint( $_GET['uid'] ) : 0;
     
    37493749 * @return string The unsubscribe link.
    37503750 */
    37513751function bp_email_get_unsubscribe_link( $args ) {
    3752         $emails = bp_email_get_type_schema( 'all' );
     3752        $emails = bp_email_get_unsubscribe_type_schema();
    37533753
    37543754        if ( empty( $args['notification_type'] ) || ! array_key_exists( $args['notification_type'], $emails ) ) {
    37553755                return site_url( 'wp-login.php' );
     
    37923792function bp_email_get_salt() {
    37933793        return bp_get_option( 'bp-emails-unsubscribe-salt', null );
    37943794}
     3795
     3796/**
     3797 * Get a list of emails for use in our unsubscribe functions.
     3798 *
     3799 * @since x.x.x
     3800 *
     3801 * @see https://buddypress.trac.wordpress.org/ticket/7431
     3802 *
     3803 * @return array The array of email types and their schema.
     3804 */
     3805function bp_email_get_unsubscribe_type_schema() {
     3806        $emails = bp_email_get_type_schema( 'all' );
     3807
     3808        /**
     3809         * Filters the return of `bp_email_get_type_schema( 'all' )` for use with
     3810         * our unsubscribe functionality.
     3811         *
     3812         * @since x.x.x
     3813         *
     3814         * @param array $emails The array of email types and their schema.
     3815         */
     3816        return (array) apply_filters( 'bp_email_get_unsubscribe_type_schema', $emails );
     3817}