Bp_Search_Activity_Comment:: sql (search_term美元only_totalrow_count美元

描述

文件:bp-search /类/ class-bp-search-activity-comments.php

函数的sql (search_term, only_totalrow_count美元= false  ){ /** * 选择不同的从wp_bp_activity a.id * * * a.is_spam = 0 *和a.content像%没有% *和a.hide_sitewide = 0 *和a.type不在(“activity_comment”、“last_activity”)* * ORDER BY a.date_recorded DESC极限0,21 * /全球wpdb美元,英国石油美元;数组$ query_placeholder = ();$sql = " SELECT ";if($only_totalrow_count){$sql .= " COUNT(DISTINCT id) ";”;} else {$sql .= " DISTINCT a.id, 'activity_comment'作为类型,a.content LIKE %s作为相关性,a.date_recorded as entry_date ";美元query_placeholder[] =‘%’。wpdb - > esc_like (search_term美元)。‘%’;$sql .= " FROM {$bp->activity->table_name} a WHERE 1=1 AND is_spam = 0 AND a.content LIKE %s AND a.hide_sitewide = 0 AND a.type = 'activity_comment' ";美元query_placeholder[] =‘%’。$wpdb->esc_like( $search_term ).'%'; $sql = $wpdb->prepare( $sql, $query_placeholder ); return apply_filters( 'Bp_Search_Activity_Comment_sql', $sql, array( 'search_term' => $search_term, 'only_totalrow_count' => $only_totalrow_count, ) ); }

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队