Changeset 6772 for trunk/src/includes/admin/replies.php
- Timestamp:
- 01/23/2018 11:26:56 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/admin/replies.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/replies.php
r6771 r6772 596 596 597 597 /** 598 * Returns an array of keys used to sort row actions 599 * 600 * @since 2.6.0 bbPress (r6771) 601 * 602 * @return array 603 */ 604 private function get_row_action_sort_order() { 605 606 // Filter & return 607 return (array) apply_filters( 'bbp_admin_reply_row_action_sort_order', array( 608 'edit', 609 'approved', 610 'unapproved', 611 'spam', 612 'trash', 613 'untrash', 614 'delete', 615 'view' 616 ) ); 617 } 618 619 /** 598 620 * Returns an array of notice toggles 599 621 * … … 754 776 * @since 2.0.0 bbPress (r2577) 755 777 * 756 * @param array $actions Actions757 * @param array $reply Replyobject778 * @param array $actions Actions 779 * @param object $reply Topic object 758 780 * 759 781 * @return array $actions Actions 760 782 */ 761 public function row_actions( $actions, $reply ) { 762 783 public function row_actions( $actions = array(), $reply = false ) { 784 785 // Disable quick edit (too much to do here) 763 786 unset( $actions['inline hide-if-no-js'] ); 764 787 … … 819 842 } 820 843 821 return $actions; 844 // Sort & return 845 return $this->sort_row_actions( $actions ); 846 } 847 848 /** 849 * Sort row actions by key 850 * 851 * @since 2.6.0 852 * 853 * @param array $actions 854 * 855 * @return array 856 */ 857 private function sort_row_actions( $actions = array() ) { 858 859 // Return value 860 $retval = array(); 861 862 // Known row actions, in sort order 863 $known_actions = $this->get_row_action_sort_order(); 864 865 // Sort known actions, and keep any unknown ones 866 foreach ( $known_actions as $key ) { 867 if ( isset( $actions[ $key ] ) ) { 868 $retval[ $key ] = $actions[ $key ]; 869 unset( $actions[ $key ] ); 870 } 871 } 872 873 // Combine & return 874 return $retval + $actions; 822 875 } 823 876
Note: See TracChangeset
for help on using the changeset viewer.