Changeset 9696
- Timestamp:
- 04/05/2015 04:30:16 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-core-user.php
r9486 r9696 377 377 } 378 378 379 // Get paginated results 379 /** 380 * Filters the SQL used to query for paged users. 381 * 382 * @since BuddyPress (1.2.6) 383 * 384 * @param string $value Concatenated SQL statement for the query. 385 * @param array $sql Array of SQL statement parts for the query. 386 */ 380 387 $paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array) $sql ), $sql ); 381 388 $paged_users = $wpdb->get_results( $paged_users_sql ); … … 402 409 array_unshift( $sql, "SELECT COUNT(u.ID)" ); 403 410 404 // Get total user results 411 /** 412 * Filters the SQL used to query for total users. 413 * 414 * @since BuddyPress (1.2.6) 415 * 416 * @param string $value Concatenated SQL statement for the query. 417 * @param array $sql Array of SQL statement parts for the query. 418 */ 405 419 $total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array) $sql ), $sql ); 406 420 $total_users = $wpdb->get_var( $total_users_sql ); … … 471 485 } 472 486 487 /** 488 * Filters the SQL used to query for total user count by first letter. 489 * 490 * @since BuddyPress (1.0.0) 491 * 492 * @param string $value SQL prepared statement for the user count query. 493 */ 473 494 $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", bp_xprofile_fullname_field_name(), $letter_like ) ); 495 496 /** 497 * Filters the SQL used to query for users by first letter. 498 * 499 * @since BuddyPress (1.0.0) 500 * 501 * @param string $value SQL prepared statement for the user query. 502 */ 474 503 $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name(), $letter_like ) ); 475 504 … … 564 593 $status_sql = bp_core_get_status_sql( 'u.' ); 565 594 595 /** 596 * Filters the SQL used to query for searched users count. 597 * 598 * @since BuddyPress (1.0.0) 599 * 600 * @param string $value SQL statement for the searched users count query. 601 */ 566 602 $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", $search_terms_like ), $search_terms ); 603 604 /** 605 * Filters the SQL used to query for searched users. 606 * 607 * @since BuddyPress (1.0.0) 608 * 609 * @param string $value SQL statement for the searched users query. 610 */ 567 611 $paged_users_sql = apply_filters( 'bp_core_search_users_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", $search_terms_like ), $search_terms, $pag_sql ); 568 612 … … 739 783 * existing entry. 740 784 * 741 * @since 2.0785 * @since BuddyPress (2.0.0) 742 786 * 743 787 * @param int $user_id ID of the user whose last_activity you are updating. … … 828 872 * Delete a user's last_activity value. 829 873 * 830 * @since 2.0874 * @since BuddyPress (2.0.0) 831 875 * 832 876 * @param int $user_id
Note: See TracChangeset
for help on using the changeset viewer.