diff --git a/src/bp-activity/classes/class-bp-activity-activity.php b/src/bp-activity/classes/class-bp-activity-activity.php
index 1d1f51a..ad1266f 100644
|
a
|
b
|
class BP_Activity_Activity { |
| 544 | 544 | */ |
| 545 | 545 | $join_sql = apply_filters( 'bp_activity_get_join_sql', $join_sql, $r, $select_sql, $from_sql, $where_sql ); |
| 546 | 546 | |
| 547 | | /** |
| 548 | | * Filters the preferred order of indexes for activity item. |
| 549 | | * |
| 550 | | * @since 1.6.0 |
| 551 | | * |
| 552 | | * @param array $value Array of indexes in preferred order. |
| 553 | | */ |
| 554 | | $indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) ); |
| 555 | | |
| 556 | | foreach( $indexes as $key => $index ) { |
| 557 | | if ( false !== strpos( $where_sql, $index ) ) { |
| 558 | | $the_index = $index; |
| 559 | | break; // Take the first one we find. |
| 560 | | } |
| 561 | | } |
| 562 | | |
| 563 | | if ( !empty( $the_index ) ) { |
| 564 | | $index_hint_sql = "USE INDEX ({$the_index})"; |
| 565 | | } else { |
| 566 | | $index_hint_sql = ''; |
| 567 | | } |
| 568 | | |
| 569 | 547 | // Sanitize page and per_page parameters. |
| 570 | 548 | $page = absint( $r['page'] ); |
| 571 | 549 | $per_page = absint( $r['per_page'] ); |