Changeset 13893 for trunk/src/bp-core/classes/class-bp-core-user.php
- Timestamp:
- 06/02/2024 02:07:21 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-core-user.php
r13890 r13893 131 131 * 132 132 * @param integer $user_id The ID for the user being queried. 133 * @param bool $populate_extras Whether to fetch extra information such as133 * @param bool $populate_extras Optional. Whether to fetch extra information such as 134 134 * group/friendship counts or not. Default: false. 135 135 */ 136 136 public function __construct( $user_id, $populate_extras = false ) { 137 if ( ! empty( $user_id ) ) {137 if ( ! empty( $user_id ) ) { 138 138 $this->id = $user_id; 139 139 $this->populate(); 140 140 141 if ( ! empty( $populate_extras ) ) {141 if ( ! empty( $populate_extras ) ) { 142 142 $this->populate_extras(); 143 143 } … … 150 150 public function populate() { 151 151 152 if ( bp_is_active( 'xprofile' ) ) 152 if ( bp_is_active( 'xprofile' ) ) { 153 153 $this->profile_data = $this->get_profile_data(); 154 155 if ( !empty( $this->profile_data ) ) { 154 } 155 156 if ( ! empty( $this->profile_data ) ) { 156 157 $full_name_field_name = bp_xprofile_fullname_field_name(); 157 158 158 159 $this->user_url = bp_members_get_user_url( $this->id ); 159 $this->fullname = esc_attr( $this->profile_data[ $full_name_field_name]['field_data'] );160 $this->fullname = esc_attr( $this->profile_data[ $full_name_field_name ]['field_data'] ); 160 161 $this->user_link = "<a href='{$this->user_url}'>{$this->fullname}</a>"; 161 162 $this->email = esc_attr( $this->profile_data['user_email'] ); … … 175 176 __( 'Profile photo of %s', 'buddypress' ), 176 177 $this->fullname 177 ) 178 ), 178 179 ) 179 180 ); … … 187 188 __( 'Profile photo of %s', 'buddypress' ), 188 189 $this->fullname 189 ) 190 ), 190 191 ) 191 192 ); … … 201 202 ), 202 203 'width' => 30, 203 'height' => 30 204 'height' => 30, 204 205 ) 205 206 ); … … 248 249 * 249 250 * @deprecated 1.7.0 Use {@link BP_User_Query}. 251 * 252 * @global wpdb $wpdb WordPress database object. 250 253 * 251 254 * @see BP_User_Query for a description of parameters, most of which … … 282 285 $sql = array(); 283 286 284 $sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";285 286 if ( 'active' == $type || 'online' == $type || 'newest' == $type) {287 $sql['select_active'] = ", um.meta_value as last_activity";288 } 289 290 if ( 'popular' == $type ) {291 $sql['select_popular'] = ", um.meta_value as total_friend_count";292 } 293 294 if ( 'alphabetical' == $type ) {295 $sql['select_alpha'] = ", pd.value as fullname";287 $sql['select_main'] = 'SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email'; 288 289 if ( 'active' === $type || 'online' === $type || 'newest' === $type ) { 290 $sql['select_active'] = ', um.meta_value as last_activity'; 291 } 292 293 if ( 'popular' === $type ) { 294 $sql['select_popular'] = ', um.meta_value as total_friend_count'; 295 } 296 297 if ( 'alphabetical' === $type ) { 298 $sql['select_alpha'] = ', pd.value as fullname'; 296 299 } 297 300 298 301 if ( $meta_key ) { 299 $sql['select_meta'] = ", umm.meta_key";302 $sql['select_meta'] = ', umm.meta_key'; 300 303 301 304 if ( $meta_value ) { 302 $sql['select_meta'] .= ", umm.meta_value";305 $sql['select_meta'] .= ', umm.meta_value'; 303 306 } 304 307 } … … 312 315 313 316 // Alphabetical sorting is done by the xprofile Full Name field. 314 if ( 'alphabetical' == $type ) {317 if ( 'alphabetical' === $type ) { 315 318 $sql['join_profiledata_alpha'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id"; 316 319 } … … 322 325 $sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' ); 323 326 324 if ( 'active' == $type || 'online' == $type || 'newest'== $type ) {325 $sql['where_active'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) );326 } 327 328 if ( 'popular' == $type ) {329 $sql['where_popular'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );330 } 331 332 if ( 'online' == $type ) {333 $sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()";334 } 335 336 if ( 'alphabetical' == $type ) {337 $sql['where_alpha'] = "AND pd.field_id = 1";338 } 339 340 if ( ! empty( $exclude ) ) {327 if ( 'active' === $type || 'online' === $type || 'newest' === $type ) { 328 $sql['where_active'] = $wpdb->prepare( 'AND um.meta_key = %s', bp_get_user_meta_key( 'last_activity' ) ); 329 } 330 331 if ( 'popular' === $type ) { 332 $sql['where_popular'] = $wpdb->prepare( 'AND um.meta_key = %s', bp_get_user_meta_key( 'total_friend_count' ) ); 333 } 334 335 if ( 'online' === $type ) { 336 $sql['where_online'] = 'AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()'; 337 } 338 339 if ( 'alphabetical' === $type ) { 340 $sql['where_alpha'] = 'AND pd.field_id = 1'; 341 } 342 343 if ( ! empty( $exclude ) ) { 341 344 $exclude = implode( ',', wp_parse_id_list( $exclude ) ); 342 345 $sql['where_exclude'] = "AND u.ID NOT IN ({$exclude})"; … … 346 349 // returned. The default value of false will hit the 'else' clause. 347 350 if ( 0 === $include || '0' === $include ) { 348 $sql['where_users'] = "AND 0 = 1"; 349 } else { 350 if ( !empty( $include ) ) { 351 $include = implode( ',', wp_parse_id_list( $include ) ); 351 $sql['where_users'] = 'AND 0 = 1'; 352 } elseif ( ! empty( $include ) ) { 353 $include = implode( ',', wp_parse_id_list( $include ) ); 352 354 $sql['where_users'] = "AND u.ID IN ({$include})"; 353 } elseif ( !empty( $user_id ) && bp_is_active( 'friends' ) ) {354 355 356 if ( !empty( $friend_ids ) ) {357 $friend_ids= implode( ',', wp_parse_id_list( $friend_ids ) );358 355 } elseif ( ! empty( $user_id ) && bp_is_active( 'friends' ) ) { 356 $friend_ids = friends_get_friend_user_ids( $user_id ); 357 358 if ( ! empty( $friend_ids ) ) { 359 $friend_ids = implode( ',', wp_parse_id_list( $friend_ids ) ); 360 $sql['where_friends'] = "AND u.ID IN ({$friend_ids})"; 359 361 360 362 // User has no friends, return false since there will be no users to fetch. 361 } else { 362 return false; 363 } 364 } 365 } 366 367 if ( !empty( $search_terms ) && bp_is_active( 'xprofile' ) ) { 363 } else { 364 return false; 365 } 366 } 367 368 if ( ! empty( $search_terms ) && bp_is_active( 'xprofile' ) ) { 368 369 $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%'; 369 $sql['where_searchterms'] = $wpdb->prepare( "AND spd.value LIKE %s", $search_terms_like );370 } 371 372 if ( ! empty( $meta_key ) ) {373 $sql['where_meta'] = $wpdb->prepare( " AND umm.meta_key = %s", $meta_key );370 $sql['where_searchterms'] = $wpdb->prepare( 'AND spd.value LIKE %s', $search_terms_like ); 371 } 372 373 if ( ! empty( $meta_key ) ) { 374 $sql['where_meta'] = $wpdb->prepare( ' AND umm.meta_key = %s', $meta_key ); 374 375 375 376 // If a meta value is provided, match it. 376 377 if ( $meta_value ) { 377 $sql['where_meta'] .= $wpdb->prepare( " AND umm.meta_value = %s", $meta_value );378 $sql['where_meta'] .= $wpdb->prepare( ' AND umm.meta_value = %s', $meta_value ); 378 379 } 379 380 } 380 381 381 382 switch ( $type ) { 382 case 'active': case 'online': default: 383 $sql[] = "ORDER BY um.meta_value DESC"; 383 case 'active': 384 case 'online': 385 default: 386 $sql[] = 'ORDER BY um.meta_value DESC'; 384 387 break; 385 388 case 'newest': 386 $sql[] = "ORDER BY u.ID DESC";389 $sql[] = 'ORDER BY u.ID DESC'; 387 390 break; 388 391 case 'alphabetical': 389 $sql[] = "ORDER BY pd.value ASC";392 $sql[] = 'ORDER BY pd.value ASC'; 390 393 break; 391 394 case 'random': 392 $sql[] = "ORDER BY rand()";395 $sql[] = 'ORDER BY rand()'; 393 396 break; 394 397 case 'popular': 395 $sql[] = "ORDER BY CONVERT(um.meta_value, SIGNED) DESC";398 $sql[] = 'ORDER BY CONVERT(um.meta_value, SIGNED) DESC'; 396 399 break; 397 400 } 398 401 399 if ( ! empty( $limit ) && !empty( $page ) ) {400 $sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );402 if ( ! empty( $limit ) && ! empty( $page ) ) { 403 $sql['pagination'] = $wpdb->prepare( 'LIMIT %d, %d', intval( ( $page - 1 ) * $limit ), intval( $limit ) ); 401 404 } 402 405 … … 415 418 unset( $sql['select_main'] ); 416 419 417 if ( ! empty( $sql['select_active'] ) ) {420 if ( ! empty( $sql['select_active'] ) ) { 418 421 unset( $sql['select_active'] ); 419 422 } 420 423 421 if ( ! empty( $sql['select_popular'] ) ) {424 if ( ! empty( $sql['select_popular'] ) ) { 422 425 unset( $sql['select_popular'] ); 423 426 } 424 427 425 if ( ! empty( $sql['select_alpha'] ) ) {428 if ( ! empty( $sql['select_alpha'] ) ) { 426 429 unset( $sql['select_alpha'] ); 427 430 } 428 431 429 if ( ! empty( $sql['pagination'] ) ) {432 if ( ! empty( $sql['pagination'] ) ) { 430 433 unset( $sql['pagination'] ); 431 434 } 432 435 433 array_unshift( $sql, "SELECT COUNT(u.ID)");436 array_unshift( $sql, 'SELECT COUNT(u.ID)' ); 434 437 435 438 /** … … 448 451 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join). 449 452 */ 450 if ( ! empty( $populate_extras ) ) {453 if ( ! empty( $populate_extras ) ) { 451 454 $user_ids = array(); 452 455 … … 456 459 457 460 // Add additional data to the returned results. 458 $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids, $type ); 459 } 460 461 return array( 'users' => $paged_users, 'total' => $total_users ); 462 } 463 461 $paged_users = self::get_user_extras( $paged_users, $user_ids, $type ); 462 } 463 464 return array( 465 'users' => $paged_users, 466 'total' => $total_users, 467 ); 468 } 464 469 465 470 /** … … 482 487 $pag_sql = ''; 483 488 if ( $limit && $page ) { 484 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );489 $pag_sql = $wpdb->prepare( ' LIMIT %d, %d', intval( ( $page - 1 ) * $limit ), intval( $limit ) ); 485 490 } 486 491 487 492 // Multibyte compliance. 488 493 if ( function_exists( 'mb_strlen' ) ) { 489 if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || ! $letter ) {494 if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || ! $letter ) { 490 495 return false; 491 496 } 492 } else { 493 if ( strlen( $letter ) > 1 || is_numeric( $letter ) || !$letter ) { 494 return false; 495 } 497 } elseif ( strlen( $letter ) > 1 || is_numeric( $letter ) || ! $letter ) { 498 return false; 496 499 } 497 500 … … 501 504 $status_sql = bp_core_get_status_sql( 'u.' ); 502 505 503 if ( ! empty( $exclude ) ) {506 if ( ! empty( $exclude ) ) { 504 507 $exclude = implode( ',', wp_parse_id_list( $exclude ) ); 505 508 $exclude_sql = " AND u.id NOT IN ({$exclude})"; … … 524 527 * @param string $value SQL prepared statement for the user query. 525 528 */ 526 $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', 529 $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 ) ); 527 530 528 531 $total_users = $wpdb->get_var( $total_users_sql ); … … 537 540 */ 538 541 $user_ids = array(); 539 foreach ( (array) $paged_users as $user ) 542 foreach ( (array) $paged_users as $user ) { 540 543 $user_ids[] = (int) $user->id; 544 } 541 545 542 546 // Add additional data to the returned results. 543 547 if ( $populate_extras ) { 544 $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids ); 545 } 546 547 return array( 'users' => $paged_users, 'total' => $total_users ); 548 $paged_users = self::get_user_extras( $paged_users, $user_ids ); 549 } 550 551 return array( 552 'users' => $paged_users, 553 'total' => $total_users, 554 ); 548 555 } 549 556 … … 566 573 567 574 $pag_sql = ''; 568 if ( $limit && $page ) 569 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 575 if ( $limit && $page ) { 576 $pag_sql = $wpdb->prepare( ' LIMIT %d, %d', intval( ( $page - 1 ) * $limit ), intval( $limit ) ); 577 } 570 578 571 579 $user_ids = implode( ',', wp_parse_id_list( $user_ids ) ); … … 638 646 639 647 // Add additional data to the returned results. 640 if ( !empty( $populate_extras ) ) { 641 $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids ); 642 } 643 644 return array( 'users' => $paged_users, 'total' => $total_users ); 648 if ( ! empty( $populate_extras ) ) { 649 $paged_users = self::get_user_extras( $paged_users, $user_ids ); 650 } 651 652 return array( 653 'users' => $paged_users, 654 'total' => $total_users, 655 ); 645 656 } 646 657 … … 663 674 664 675 $user_ids = array(); 665 $pag_sql = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';676 $pag_sql = $limit && $page ? $wpdb->prepare( ' LIMIT %d, %d', intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : ''; 666 677 667 678 $search_terms_like = '%' . bp_esc_like( $search_terms ) . '%'; … … 684 695 * @param string $value SQL statement for the searched users query. 685 696 */ 686 $paged_users_sql = apply_filters( 'bp_core_search_users_sql', 697 $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 ); 687 698 688 699 $total_users = $wpdb->get_var( $total_users_sql ); … … 693 704 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join) 694 705 */ 695 foreach ( (array) $paged_users as $user ) 706 foreach ( (array) $paged_users as $user ) { 696 707 $user_ids[] = $user->id; 708 } 697 709 698 710 // Add additional data to the returned results. 699 if ( $populate_extras ) 700 $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids ); 701 702 return array( 'users' => $paged_users, 'total' => $total_users ); 711 if ( $populate_extras ) { 712 $paged_users = self::get_user_extras( $paged_users, $user_ids ); 713 } 714 715 return array( 716 'users' => $paged_users, 717 'total' => $total_users, 718 ); 703 719 } 704 720 … … 720 736 $bp = buddypress(); 721 737 722 if ( empty( $user_ids ) ) 738 if ( empty( $user_ids ) ) { 723 739 return $paged_users; 740 } 724 741 725 742 // Sanitize user IDs. … … 727 744 728 745 // Fetch the user's full name. 729 if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) {746 if ( bp_is_active( 'xprofile' ) && 'alphabetical' !== $type ) { 730 747 $names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", bp_xprofile_fullname_field_name() ) ); 731 748 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 732 749 foreach ( (array) $names as $name ) { 733 if ( $name->id == $paged_users[$i]->id ) 734 $paged_users[$i]->fullname = $name->fullname; 750 if ( $name->id === $paged_users[ $i ]->id ) { 751 $paged_users[ $i ]->fullname = $name->fullname; 752 } 735 753 } 736 754 } … … 738 756 739 757 // Fetch the user's total friend count. 740 if ( 'popular' != $type ) {758 if ( 'popular' !== $type ) { 741 759 $friend_count = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as total_friend_count FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'total_friend_count' ) ) ); 742 760 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 743 761 foreach ( (array) $friend_count as $fcount ) { 744 if ( $fcount->id == $paged_users[$i]->id ) 745 $paged_users[$i]->total_friend_count = (int) $fcount->total_friend_count; 762 if ( $fcount->id === $paged_users[ $i ]->id ) { 763 $paged_users[ $i ]->total_friend_count = (int) $fcount->total_friend_count; 764 } 746 765 } 747 766 } … … 753 772 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 754 773 foreach ( (array) $friend_status as $status ) { 755 if ( $status->initiator_user_id == $paged_users[$i]->id || $status->friend_user_id == $paged_users[$i]->id ) 756 $paged_users[$i]->is_friend = $status->is_confirmed; 774 if ( $status->initiator_user_id === $paged_users[ $i ]->id || $status->friend_user_id === $paged_users[ $i ]->id ) { 775 $paged_users[ $i ]->is_friend = $status->is_confirmed; 776 } 757 777 } 758 778 } … … 760 780 761 781 // Fetch the user's last_activity. 762 if ( 'active' != $type ) {782 if ( 'active' !== $type ) { 763 783 $user_activity = self::get_last_activity( $user_ids ); 764 784 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 765 785 foreach ( (array) $user_activity as $activity ) { 766 if ( ! empty( $activity['user_id'] ) && (int) $activity['user_id'] === (int) $paged_users[ $i]->id ) {767 $paged_users[ $i]->last_activity = $activity['date_recorded'];786 if ( ! empty( $activity['user_id'] ) && (int) $activity['user_id'] === (int) $paged_users[ $i ]->id ) { 787 $paged_users[ $i ]->last_activity = $activity['date_recorded']; 768 788 } 769 789 } … … 775 795 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 776 796 foreach ( (array) $user_update as $update ) { 777 if ( $update->id == $paged_users[$i]->id ) 778 $paged_users[$i]->latest_update = $update->latest_update; 797 if ( $update->id === $paged_users[ $i ]->id ) { 798 $paged_users[ $i ]->latest_update = $update->latest_update; 799 } 779 800 } 780 801 } … … 789 810 * 790 811 * @param int $user_id User ID. 791 * @return false|object WP_Userif successful, false on failure.812 * @return false|object User object if successful, false on failure. 792 813 */ 793 814 public static function get_core_userdata( $user_id ) { … … 797 818 /** 798 819 * Get last activity data for a user or set of users. 820 * 821 * @global wpdb $wpdb WordPress database object. 799 822 * 800 823 * @param int|array $user_id User IDs or multiple user IDs. … … 821 844 822 845 foreach ( $last_activities as $last_activity ) { 823 wp_cache_set( $last_activity->user_id, array( 824 'user_id' => $last_activity->user_id, 825 'date_recorded' => $last_activity->date_recorded, 826 'activity_id' => $last_activity->id, 827 ), 'bp_last_activity' ); 846 wp_cache_set( 847 $last_activity->user_id, 848 array( 849 'user_id' => $last_activity->user_id, 850 'date_recorded' => $last_activity->date_recorded, 851 'activity_id' => $last_activity->id, 852 ), 853 'bp_last_activity' 854 ); 828 855 } 829 856 } … … 835 862 836 863 if ( isset( $retval['user_id'] ) ) { 837 $retval[ $user_id ]['user_id'] 864 $retval[ $user_id ]['user_id'] = (int) $retval[ $user_id ]['user_id']; 838 865 } 839 866 if ( isset( $retval['activity_id'] ) ) { … … 852 879 * 853 880 * @since 2.0.0 881 * 882 * @global wpdb $wpdb WordPress database object. 854 883 * 855 884 * @param int $user_id ID of the user whose last_activity you are updating. … … 867 896 $updated = $wpdb->update( 868 897 $table_name, 869 870 898 // Data to update. 871 899 array( 872 900 'date_recorded' => $time, 873 901 ), 874 875 902 // WHERE. 876 903 array( 877 904 'id' => $activity[ $user_id ]['activity_id'], 878 905 ), 879 880 906 // Data sanitization format. 881 907 array( 882 908 '%s', 883 909 ), 884 885 910 // WHERE sanitization format. 886 911 array( … … 895 920 $updated = $wpdb->insert( 896 921 $table_name, 897 898 922 // Data. 899 923 array( … … 907 931 'date_recorded' => $time, 908 932 ), 909 910 933 // Data sanitization format. 911 934 array( … … 923 946 // Set up activity array for caching. 924 947 // View the foreach loop in the get_last_activity() method for format. 925 $activity = array();948 $activity = array(); 926 949 $activity[ $user_id ] = array( 927 950 'user_id' => $user_id, … … 952 975 * @since 2.0.0 953 976 * 977 * @global wpdb $wpdb WordPress database object. 978 * 954 979 * @param int $user_id ID of the user whose activity should be deleted. 955 980 * @return bool … … 966 991 $deleted = $wpdb->delete( 967 992 buddypress()->members->table_name_last_activity, 968 969 993 // WHERE. 970 994 array( 971 995 'id' => $existing[ $user_id ]['activity_id'], 972 996 ), 973 974 997 // WHERE sanitization format. 975 998 array(
Note: See TracChangeset
for help on using the changeset viewer.