384 | | 'page' => 1, // The current page. |
385 | | 'per_page' => 25, // Activity items per page. |
386 | | 'max' => false, // Max number of items to return. |
387 | | 'fields' => 'all', // Fields to include. |
388 | | 'sort' => 'DESC', // ASC or DESC. |
389 | | 'exclude' => false, // Array of ids to exclude. |
390 | | 'in' => false, // Array of ids to limit query by (IN). |
391 | | 'meta_query' => false, // Filter by activitymeta. |
392 | | 'date_query' => false, // Filter by date. |
393 | | 'filter_query' => false, // Advanced filtering - see BP_Activity_Query. |
394 | | 'filter' => false, // See self::get_filter_sql(). |
395 | | 'scope' => false, // Preset activity arguments. |
396 | | 'search_terms' => false, // Terms to search by. |
397 | | 'display_comments' => false, // Whether to include activity comments. |
398 | | 'show_hidden' => false, // Show items marked hide_sitewide. |
399 | | 'spam' => 'ham_only', // Spam status. |
400 | | 'update_meta_cache' => true, // Whether or not to update meta cache. |
401 | | 'count_total' => false, // Whether or not to use count_total. |
| 384 | 'page' => 1, // The current page. |
| 385 | 'per_page' => 25, // Activity items per page. |
| 386 | 'max' => false, // Max number of items to return. |
| 387 | 'fields' => 'all', // Fields to include. |
| 388 | 'sort' => 'DESC', // ASC or DESC. |
| 389 | 'order_by' => 'date_recorded', // Column to order by. |
| 390 | 'exclude' => false, // Array of ids to exclude. |
| 391 | 'in' => false, // Array of ids to limit query by (IN). |
| 392 | 'meta_query' => false, // Filter by activitymeta. |
| 393 | 'date_query' => false, // Filter by date. |
| 394 | 'filter_query' => false, // Advanced filtering - see BP_Activity_Query. |
| 395 | 'filter' => false, // See self::get_filter_sql(). |
| 396 | 'scope' => false, // Preset activity arguments. |
| 397 | 'search_terms' => false, // Terms to search by. |
| 398 | 'display_comments' => false, // Whether to include activity comments. |
| 399 | 'show_hidden' => false, // Show items marked hide_sitewide. |
| 400 | 'spam' => 'ham_only', // Spam status. |
| 401 | 'update_meta_cache' => true, // Whether or not to update meta cache. |
| 402 | 'count_total' => false, // Whether or not to use count_total. |
| 465 | $order_by_columns = array( |
| 466 | 'id', 'user_id', 'component', 'type', 'action', 'content', 'primary_link', 'item_id', 'secondary_item_id', 'date_recorded', |
| 467 | ); |
| 468 | |
| 469 | $order_by = 'a.' . $r['order_by']; |
| 470 | if ( ! array_key_exists( $r['order_by'], array_flip( $order_by_columns ) ) ) { |
| 471 | // Fall back or original value in case user provided value is not valid. |
| 472 | $order_by = 'a.date_recorded'; |
| 473 | } |
| 474 | |