Changeset 5300 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php
- Timestamp:
- 04/09/2017 08:31:01 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
r5299 r5300 29 29 add_filter( 'bbp_after_has_topics_parse_args', array( $this, 'add_post_status_to_query' ) ); 30 30 add_filter( 'bbp_after_has_replies_parse_args', array( $this, 'add_post_status_to_query' ) ); 31 32 // Adjust the list of admin links for topics and replies. 31 33 add_filter( 'bbp_topic_admin_links', array( $this, 'admin_links' ), 10, 2 ); 32 34 add_filter( 'bbp_reply_admin_links', array( $this, 'admin_links' ), 10, 2 ); … … 245 247 } 246 248 249 /** 250 * Remove some unneeded or redundant admin links for topics and replies, 251 * move less commonly used inline quick links to 'Topic Admin' sidebar section. 252 * 253 * @param array $r Admin links array. 254 * @param int $post_id Topic or reply ID. 255 * @return array Filtered admin links array. 256 */ 247 257 public function admin_links( $r, $post_id ) { 258 /* 259 * Remove 'Trash' from admin links. Trashing a topic or reply will eventually 260 * permanently delete it when the trash is emptied. Better to mark it as pending or spam. 261 */ 262 unset( $r['trash'] ); 263 264 /* 265 * Remove 'Reply' link. The theme adds its own 'Reply to Topic' sidebar link 266 * for quick access to reply form, making the default inline link redundant. 267 */ 268 unset( $r['reply'] ); 269 270 /* 271 * The following actions are removed from inline quick links as less commonly used, 272 * but are still available via 'Topic Admin' sidebar section. 273 */ 274 if ( ! did_action( 'wporg_compat_single_topic_sidebar_pre' ) ) { 275 // Remove 'Merge' link. 276 unset( $r['merge'] ); 277 278 // Remove 'Stick' link for moderators, but keep it for plugin/theme authors and contributors. 279 if ( current_user_can( 'moderate', $post_id ) ) { 280 unset( $r['stick'] ); 281 } 282 } 283 284 // Add 'Archive' link. 248 285 $r['archive'] = $this->get_archive_link( array( 'post_id' => $post_id ) ); 286 249 287 return $r; 250 288 }
Note: See TracChangeset
for help on using the changeset viewer.