- Timestamp:
- 03/21/2017 01:35:23 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-activity.php
r11447 r11516 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.0551 *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'] );
Note: See TracChangeset
for help on using the changeset viewer.