Making WordPress.org


Ignore:
Timestamp:
11/11/2025 06:51:51 AM (11 months ago)
Author:
dd32
Message:

Helpscout: Display forum role in helpscout widget, match wildcardy on gmail addresses.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/profile.php

    r12608 r14599  
    2828                        $html .= '<p>Account Email: ' . esc_html( $user->user_email ) . '</p>';
    2929                }
     30
     31                if ( in_array( 'bbp_blocked', $user->wporg_419_capabilities ?? [], true ) ) {
     32                        $html .= '<p><strong>Forums Status: BLOCKED</strong></p>';
     33                } elseif ( in_array( 'bbp_spectator', $user->wporg_419_capabilities ?? [], true ) ) {
     34                        $html .= '<p><strong>Forums Status: Spectator</strong></p>';
     35                }
    3036        } else {
    3137                $html .= '<p>No profile found</p>';
     38        }
     39
     40        $gmail_dotless = $request->customer->email;
     41        if ( str_ends_with( strtolower( $gmail_dotless ), '@gmail.com' ) ) {
     42                $gmail_dotless = str_replace( '.', '', strstr( $gmail_dotless, '@', true ) ) . '@gmail.com';
    3243        }
    3344
    … …  
    3546        $records = $wpdb->get_results( $wpdb->prepare(
    3647                "SELECT * FROM {$wpdb->base_prefix}user_pending_registrations
    37                 WHERE user_email = %s OR user_email LIKE %s",
     48                WHERE user_email = %s OR user_email = %s OR user_email LIKE %s",
    3849                $request->customer->email,
     50                $gmail_dotless,
    3951                str_replace( '@', '+%@', $wpdb->esc_like( $request->customer->email ) ) // Handle plus addressing.
    4052        ) );
Note: See TracChangeset for help on using the changeset viewer.