- Timestamp:
- 08/17/2021 06:37:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/classes/class-bp-notifications-notification.php
r12753 r13069 85 85 */ 86 86 public $is_new; 87 88 /** 89 * Columns in the notifications table. 90 * 91 * @since 9.1.0 92 * @access public 93 * @var array 94 */ 95 public static $columns = array( 96 'id', 97 'user_id', 98 'item_id', 99 'secondary_item_id', 100 'component_name', 101 'component_action', 102 'date_notified', 103 'is_new' 104 ); 87 105 88 106 /** Public Methods ********************************************************/ … … 407 425 // Order by. 408 426 if ( ! empty( $args['order_by'] ) ) { 409 $order_by = implode( ', ', (array) $args['order_by'] ); 410 $conditions['order_by'] = "{$order_by}"; 427 $order_by_clean = array(); 428 foreach ( (array) $args['order_by'] as $key => $value ) { 429 if ( in_array( $value, self::$columns, true ) ) { 430 $order_by_clean[] = $value; 431 } 432 } 433 if ( ! empty( $order_by_clean ) ) { 434 $order_by = implode( ', ', $order_by_clean ); 435 $conditions['order_by'] = "{$order_by}"; 436 } 411 437 } 412 438
Note: See TracChangeset
for help on using the changeset viewer.