Changeset 5299
- Timestamp:
- 04/09/2017 08:17:56 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php
r5294 r5299 25 25 // Archived post status. 26 26 add_action( 'bbp_register_post_statuses', array( $this, 'register_post_statuses' ) ); 27 add_filter( 'bbp_get_reply_statuses', array( $this, 'get_reply_statuses' ), 10, 2 ); 27 28 add_action( 'bbp_get_request', array( $this, 'archive_handler' ) ); 28 29 add_filter( 'bbp_after_has_topics_parse_args', array( $this, 'add_post_status_to_query' ) ); … … 151 152 } 152 153 154 /** 155 * Remove 'Trash' from reply statuses, add 'Archived' status instead. 156 * 157 * @param array $r Reply statuses array. 158 * @param int $reply_id Reply ID. 159 * @return array Filtered reply statuses array. 160 */ 161 public function get_reply_statuses( $r, $reply_id ) { 162 /* 163 * Remove 'Trash' from reply statuses. Trashing a reply will eventually permanently 164 * delete it when the trash is emptied. Better to mark it as pending or spam. 165 */ 166 unset( $r['trash'] ); 167 168 $r[ self::ARCHIVED ] = _x( 'Archived', 'post', 'wporg-forums' ); 169 170 return $r; 171 } 172 153 173 public function archive_handler( $action = '' ) { 154 174 if ( ! in_array( $action, $this->get_valid_actions() ) ) {
Note: See TracChangeset
for help on using the changeset viewer.