Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/17/2021 08:35:54 PM (2 years ago)
Author:
dcavins
Message:

BP_Invitation: Improve search_terms support for useful columns.

Instead of searching the class column, which would potentially return
surprising results, search the invitee_email and content columns.

Fixes #8443.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-invitation.php

    r12547 r12866  
    423423         * Only create a where statement if something less than "all" has been
    424424         * specifically requested.
    425          */ 
     425         */
    426426        if ( ! empty( $args['invite_sent'] ) && 'all' !== $args['invite_sent'] ) {
    427427            if ( $args['invite_sent'] == 'draft' ) {
     
    444444        if ( ! empty( $args['search_terms'] ) ) {
    445445            $search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
    446             $where_conditions['search_terms'] = $wpdb->prepare( "( class LIKE %s )", $search_terms_like, $search_terms_like );
     446            $where_conditions['search_terms'] = $wpdb->prepare( '( invitee_email LIKE %s OR content LIKE %s )', $search_terms_like, $search_terms_like );
    447447        }
    448448
Note: See TracChangeset for help on using the changeset viewer.