PluginProbe
bbPress / 2.1.1
bbPress v2.1.1
trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.2.2 All 71 releases
bbpress / bbp-admin / bbp-forums.php

bbp-forums.php in bbPress 2.1.1, at bbp-admin/bbp-forums.php

598 lines 22.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * bbPress Forum Admin Class
5 *
6 * @package bbPress
7 * @subpackage Administration
8 */
9
10 // Exit if accessed directly
11 if ( !defined( 'ABSPATH' ) ) exit;
12
13 if ( !class_exists( 'BBP_Forums_Admin' ) ) :
14 /**
15 * Loads bbPress forums admin area
16 *
17 * @package bbPress
18 * @subpackage Administration
19 * @since bbPress (r2464)
20 */
21 class BBP_Forums_Admin {
22
23 /** Variables *************************************************************/
24
25 /**
26 * @var The post type of this admin component
27 */
28 private $post_type = '';
29
30 /** Functions *************************************************************/
31
32 /**
33 * The main bbPress forums admin loader
34 *
35 * @since bbPress (r2515)
36 *
37 * @uses BBP_Forums_Admin::setup_globals() Setup the globals needed
38 * @uses BBP_Forums_Admin::setup_actions() Setup the hooks and actions
39 * @uses BBP_Forums_Admin::setup_help() Setup the help text
40 */
41 public function __construct() {
42 $this->setup_globals();
43 $this->setup_actions();
44 }
45
46 /**
47 * Setup the admin hooks, actions and filters
48 *
49 * @since bbPress (r2646)
50 * @access private
51 *
52 * @uses add_action() To add various actions
53 * @uses add_filter() To add various filters
54 * @uses bbp_get_forum_post_type() To get the forum post type
55 * @uses bbp_get_topic_post_type() To get the topic post type
56 * @uses bbp_get_reply_post_type() To get the reply post type
57 */
58 private function setup_actions() {
59
60 // Add some general styling to the admin area
61 add_action( 'bbp_admin_head', array( $this, 'admin_head' ) );
62
63 // Messages
64 add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
65
66 // Metabox actions
67 add_action( 'add_meta_boxes', array( $this, 'attributes_metabox' ) );
68 add_action( 'save_post', array( $this, 'attributes_metabox_save' ) );
69
70 // Column headers.
71 add_filter( 'manage_' . $this->post_type . '_posts_columns', array( $this, 'column_headers' ) );
72
73 // Columns (in page row)
74 add_action( 'manage_' . $this->post_type . '_posts_custom_column', array( $this, 'column_data' ), 10, 2 );
75 add_filter( 'page_row_actions', array( $this, 'row_actions' ), 10, 2 );
76
77 // Contextual Help
78 add_action( 'load-edit.php', array( $this, 'edit_help' ) );
79 add_action( 'load-post-new.php', array( $this, 'new_help' ) );
80 }
81
82 /**
83 * Should we bail out of this method?
84 *
85 * @since bbPress (r4067)
86 * @return boolean
87 */
88 private function bail() {
89 if ( !isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) )
90 return true;
91
92 return false;
93 }
94
95 /**
96 * Admin globals
97 *
98 * @since bbPress (r2646)
99 * @access private
100 */
101 private function setup_globals() {
102 $this->post_type = bbp_get_forum_post_type();
103 }
104
105 /** Contextual Help *******************************************************/
106
107 /**
108 * Contextual help for bbPress forum edit page
109 *
110 * @since bbPress (r3119)
111 * @uses get_current_screen()
112 */
113 public function edit_help() {
114
115 if ( $this->bail() ) return;
116
117 // Overview
118 get_current_screen()->add_help_tab( array(
119 'id' => 'overview',
120 'title' => __( 'Overview', 'bbpress' ),
121 'content' =>
122 '<p>' . __( 'This screen provides access to all of your replies. You can customize the display of this screen to suit your workflow.', 'bbpress' ) . '</p>'
123 ) );
124
125 // Screen Content
126 get_current_screen()->add_help_tab( array(
127 'id' => 'screen-content',
128 'title' => __( 'Screen Content', 'bbpress' ),
129 'content' =>
130 '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:', 'bbpress' ) . '</p>' .
131 '<ul>' .
132 '<li>' . __( 'You can hide/display columns based on your needs and decide how many replies to list per screen using the Screen Options tab.', 'bbpress' ) . '</li>' .
133 '<li>' . __( 'You can filter the list of replies by forum status using the text links in the upper left to show All, Published, Draft, or Trashed replies. The default view is to show all replies.', 'bbpress' ) . '</li>' .
134 '<li>' . __( 'You can view replies in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.', 'bbpress' ) . '</li>' .
135 '<li>' . __( 'You can refine the list to show only replies in a specific category or from a specific month by using the dropdown menus above the replies list. Click the Filter button after making your selection. You also can refine the list by clicking on the forum author, category or tag in the replies list.', 'bbpress' ) . '</li>' .
136 '</ul>'
137 ) );
138
139 // Available Actions
140 get_current_screen()->add_help_tab( array(
141 'id' => 'action-links',
142 'title' => __( 'Available Actions', 'bbpress' ),
143 'content' =>
144 '<p>' . __( 'Hovering over a row in the replies list will display action links that allow you to manage your forum. You can perform the following actions:', 'bbpress' ) . '</p>' .
145 '<ul>' .
146 '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that forum. You can also reach that screen by clicking on the forum title.', 'bbpress' ) . '</li>' .
147 //'<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your forum, allowing you to update forum details without leaving this screen.', 'bbpress' ) . '</li>' .
148 '<li>' . __( '<strong>Trash</strong> removes your forum from this list and places it in the trash, from which you can permanently delete it.', 'bbpress' ) . '</li>' .
149 '<li>' . __( '<strong>Spam</strong> removes your forum from this list and places it in the spam queue, from which you can permanently delete it.', 'bbpress' ) . '</li>' .
150 '<li>' . __( '<strong>Preview</strong> will show you what your draft forum will look like if you publish it. View will take you to your live site to view the forum. Which link is available depends on your forum&#8217;s status.', 'bbpress' ) . '</li>' .
151 '</ul>'
152 ) );
153
154 // Bulk Actions
155 get_current_screen()->add_help_tab( array(
156 'id' => 'bulk-actions',
157 'title' => __( 'Bulk Actions', 'bbpress' ),
158 'content' =>
159 '<p>' . __( 'You can also edit or move multiple replies to the trash at once. Select the replies you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.', 'bbpress' ) . '</p>' .
160 '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected replies at once. To remove a forum from the grouping, just click the x next to its name in the Bulk Edit area that appears.', 'bbpress' ) . '</p>'
161 ) );
162
163 // Help Sidebar
164 get_current_screen()->set_help_sidebar(
165 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
166 '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
167 '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
168 );
169 }
170
171 /**
172 * Contextual help for bbPress forum edit page
173 *
174 * @since bbPress (r3119)
175 * @uses get_current_screen()
176 */
177 public function new_help() {
178
179 if ( $this->bail() ) return;
180
181 $customize_display = '<p>' . __( 'The title field and the big forum editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.', 'bbpress' ) . '</p>';
182
183 get_current_screen()->add_help_tab( array(
184 'id' => 'customize-display',
185 'title' => __( 'Customizing This Display', 'bbpress' ),
186 'content' => $customize_display,
187 ) );
188
189 get_current_screen()->add_help_tab( array(
190 'id' => 'title-forum-editor',
191 'title' => __( 'Title and Forum Editor', 'bbpress' ),
192 'content' =>
193 '<p>' . __( '<strong>Title</strong> - Enter a title for your forum. After you enter a title, you&#8217;ll see the permalink below, which you can edit.', 'bbpress' ) . '</p>' .
194 '<p>' . __( '<strong>Forum Editor</strong> - Enter the text for your forum. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your forum text. You can insert media files by clicking the icons above the forum editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in HTML mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular forum editor.', 'bbpress' ) . '</p>'
195 ) );
196
197 $publish_box = '<p>' . __( '<strong>Publish</strong> - You can set the terms of publishing your forum in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a forum or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a forum to be published in the future or backdate a forum.', 'bbpress' ) . '</p>';
198
199 if ( current_theme_supports( 'forum-formats' ) && forum_type_supports( 'forum', 'forum-formats' ) ) {
200 $publish_box .= '<p>' . __( '<strong>forum Format</strong> - This designates how your theme will display a specific forum. For example, you could have a <em>standard</em> blog forum with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each forum format</a>. Your theme could enable all or some of 10 possible formats.', 'bbpress' ) . '</p>';
201 }
202
203 if ( current_theme_supports( 'forum-thumbnails' ) && forum_type_supports( 'forum', 'thumbnail' ) ) {
204 $publish_box .= '<p>' . __( '<strong>Featured Image</strong> - This allows you to associate an image with your forum without inserting it. This is usually useful only if your theme makes use of the featured image as a forum thumbnail on the home page, a custom header, etc.', 'bbpress' ) . '</p>';
205 }
206
207 get_current_screen()->add_help_tab( array(
208 'id' => 'forum-attributes',
209 'title' => __( 'Forum Attributes', 'bbpress' ),
210 'content' =>
211 '<p>' . __( 'Select the attributes that your forum should have:', 'bbpress' ) . '</p>' .
212 '<ul>' .
213 '<li>' . __( '<strong>Type</strong> indicates if the forum is a category or forum. Categories generally contain other forums.', 'bbpress' ) . '</li>' .
214 '<li>' . __( '<strong>Status</strong> allows you to close a forum to new topics and replies.', 'bbpress' ) . '</li>' .
215 '<li>' . __( '<strong>Visibility</strong> lets you pick the scope of each forum and what users are allowed to access it.', 'bbpress' ) . '</li>' .
216 '<li>' . __( '<strong>Parent</strong> dropdown determines the parent forum. Select the forum or category from the dropdown, or leave the default (No Parent) to create the forum at the root of your forums.', 'bbpress' ) . '</li>' .
217 '<li>' . __( '<strong>Order</strong> allows you to order your forums numerically.', 'bbpress' ) . '</li>' .
218 '</ul>'
219 ) );
220
221 get_current_screen()->add_help_tab( array(
222 'id' => 'publish-box',
223 'title' => __( 'Publish Box', 'bbpress' ),
224 'content' => $publish_box,
225 ) );
226
227 get_current_screen()->add_help_tab( array(
228 'id' => 'discussion-settings',
229 'title' => __( 'Discussion Settings', 'bbpress' ),
230 'content' =>
231 '<p>' . __( '<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.', 'bbpress' ) . '</p>' .
232 '<p>' . __( '<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the forum, you can see them here and moderate them.', 'bbpress' ) . '</p>'
233 ) );
234
235 get_current_screen()->set_help_sidebar(
236 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
237 '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
238 '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
239 );
240 }
241
242 /**
243 * Add the forum attributes metabox
244 *
245 * @since bbPress (r2746)
246 *
247 * @uses bbp_get_forum_post_type() To get the forum post type
248 * @uses add_meta_box() To add the metabox
249 * @uses do_action() Calls 'bbp_forum_attributes_metabox'
250 */
251 public function attributes_metabox() {
252
253 if ( $this->bail() ) return;
254
255 add_meta_box (
256 'bbp_forum_attributes',
257 __( 'Forum Attributes', 'bbpress' ),
258 'bbp_forum_metabox',
259 $this->post_type,
260 'side',
261 'high'
262 );
263
264 do_action( 'bbp_forum_attributes_metabox' );
265 }
266
267 /**
268 * Pass the forum attributes for processing
269 *
270 * @since bbPress (r2746)
271 *
272 * @param int $forum_id Forum id
273 * @uses current_user_can() To check if the current user is capable of
274 * editing the forum
275 * @uses bbp_get_forum() To get the forum
276 * @uses bbp_is_forum_closed() To check if the forum is closed
277 * @uses bbp_is_forum_category() To check if the forum is a category
278 * @uses bbp_is_forum_private() To check if the forum is private
279 * @uses bbp_close_forum() To close the forum
280 * @uses bbp_open_forum() To open the forum
281 * @uses bbp_categorize_forum() To make the forum a category
282 * @uses bbp_normalize_forum() To make the forum normal (not category)
283 * @uses bbp_privatize_forum() To mark the forum as private
284 * @uses bbp_publicize_forum() To mark the forum as public
285 * @uses do_action() Calls 'bbp_forum_attributes_metabox_save' with the
286 * forum id
287 * @return int Forum id
288 */
289 public function attributes_metabox_save( $forum_id ) {
290
291 if ( $this->bail() ) return $forum_id;
292
293 // Bail if doing an autosave
294 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
295 return $forum_id;
296
297 // Bail if not a post request
298 if ( 'POST' != strtoupper( $_SERVER['REQUEST_METHOD'] ) )
299 return $forum_id;
300
301 // Nonce check
302 if ( empty( $_POST['bbp_forum_metabox'] ) || !wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) )
303 return $forum_id;
304
305 // Only save for forum post-types
306 if ( ! bbp_is_forum( $forum_id ) )
307 return $forum_id;
308
309 // Bail if current user cannot edit this forum
310 if ( !current_user_can( 'edit_forum', $forum_id ) )
311 return $forum_id;
312
313 // Parent ID
314 $parent_id = ( !empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0;
315
316 // Update the forum meta bidness
317 bbp_update_forum( array(
318 'forum_id' => $forum_id,
319 'post_parent' => (int) $parent_id
320 ) );
321
322 do_action( 'bbp_forum_attributes_metabox_save', $forum_id );
323
324 return $forum_id;
325 }
326
327 /**
328 * Add some general styling to the admin area
329 *
330 * @since bbPress (r2464)
331 *
332 * @uses bbp_get_forum_post_type() To get the forum post type
333 * @uses bbp_get_topic_post_type() To get the topic post type
334 * @uses bbp_get_reply_post_type() To get the reply post type
335 * @uses sanitize_html_class() To sanitize the classes
336 * @uses do_action() Calls 'bbp_admin_head'
337 */
338 public function admin_head() {
339
340 if ( $this->bail() ) return;
341
342 ?>
343
344 <style type="text/css" media="screen">
345 /*<![CDATA[*/
346
347 #misc-publishing-actions,
348 #save-post {
349 display: none;
350 }
351
352 strong.label {
353 display: inline-block;
354 width: 60px;
355 }
356
357 #bbp_forum_attributes hr {
358 border-style: solid;
359 border-width: 1px;
360 border-color: #ccc #fff #fff #ccc;
361 }
362
363 .column-bbp_forum_topic_count,
364 .column-bbp_forum_reply_count,
365 .column-bbp_topic_reply_count,
366 .column-bbp_topic_voice_count {
367 width: 8% !important;
368 }
369
370 .column-author,
371 .column-bbp_reply_author,
372 .column-bbp_topic_author {
373 width: 10% !important;
374 }
375
376 .column-bbp_topic_forum,
377 .column-bbp_reply_forum,
378 .column-bbp_reply_topic {
379 width: 10% !important;
380 }
381
382 .column-bbp_forum_freshness,
383 .column-bbp_topic_freshness {
384 width: 10% !important;
385 }
386
387 .column-bbp_forum_created,
388 .column-bbp_topic_created,
389 .column-bbp_reply_created {
390 width: 15% !important;
391 }
392
393 .status-closed {
394 background-color: #eaeaea;
395 }
396
397 .status-spam {
398 background-color: #faeaea;
399 }
400
401 /*]]>*/
402 </style>
403
404 <?php
405 }
406
407 /**
408 * Manage the column headers for the forums page
409 *
410 * @since bbPress (r2485)
411 *
412 * @param array $columns The columns
413 * @uses apply_filters() Calls 'bbp_admin_forums_column_headers' with
414 * the columns
415 * @return array $columns bbPress forum columns
416 */
417 public function column_headers( $columns ) {
418
419 if ( $this->bail() ) return $columns;
420
421 $columns = array (
422 'cb' => '<input type="checkbox" />',
423 'title' => __( 'Forum', 'bbpress' ),
424 'bbp_forum_topic_count' => __( 'Topics', 'bbpress' ),
425 'bbp_forum_reply_count' => __( 'Replies', 'bbpress' ),
426 'author' => __( 'Creator', 'bbpress' ),
427 'bbp_forum_created' => __( 'Created' , 'bbpress' ),
428 'bbp_forum_freshness' => __( 'Freshness', 'bbpress' )
429 );
430
431 return apply_filters( 'bbp_admin_forums_column_headers', $columns );
432 }
433
434 /**
435 * Print extra columns for the forums page
436 *
437 * @since bbPress (r2485)
438 *
439 * @param string $column Column
440 * @param int $forum_id Forum id
441 * @uses bbp_forum_topic_count() To output the forum topic count
442 * @uses bbp_forum_reply_count() To output the forum reply count
443 * @uses get_the_date() Get the forum creation date
444 * @uses get_the_time() Get the forum creation time
445 * @uses esc_attr() To sanitize the forum creation time
446 * @uses bbp_get_forum_last_active_time() To get the time when the forum was
447 * last active
448 * @uses do_action() Calls 'bbp_admin_forums_column_data' with the
449 * column and forum id
450 */
451 public function column_data( $column, $forum_id ) {
452
453 if ( $this->bail() ) return;
454
455 switch ( $column ) {
456 case 'bbp_forum_topic_count' :
457 bbp_forum_topic_count( $forum_id );
458 break;
459
460 case 'bbp_forum_reply_count' :
461 bbp_forum_reply_count( $forum_id );
462 break;
463
464 case 'bbp_forum_created':
465 printf( __( '%1$s <br /> %2$s', 'bbpress' ),
466 get_the_date(),
467 esc_attr( get_the_time() )
468 );
469
470 break;
471
472 case 'bbp_forum_freshness' :
473 $last_active = bbp_get_forum_last_active_time( $forum_id, false );
474 if ( !empty( $last_active ) )
475 echo $last_active;
476 else
477 _e( 'No Topics', 'bbpress' );
478
479 break;
480
481 default:
482 do_action( 'bbp_admin_forums_column_data', $column, $forum_id );
483 break;
484 }
485 }
486
487 /**
488 * Forum Row actions
489 *
490 * Remove the quick-edit action link and display the description under
491 * the forum title
492 *
493 * @since bbPress (r2577)
494 *
495 * @param array $actions Actions
496 * @param array $forum Forum object
497 * @uses the_content() To output forum description
498 * @return array $actions Actions
499 */
500 public function row_actions( $actions, $forum ) {
501
502 if ( $this->bail() ) return $actions;
503
504 unset( $actions['inline hide-if-no-js'] );
505
506 // simple hack to show the forum description under the title
507 bbp_forum_content( $forum->ID );
508
509 return $actions;
510 }
511
512 /**
513 * Custom user feedback messages for forum post type
514 *
515 * @since bbPress (r3080)
516 *
517 * @global int $post_ID
518 * @uses bbp_get_forum_permalink()
519 * @uses wp_post_revision_title()
520 * @uses esc_url()
521 * @uses add_query_arg()
522 *
523 * @param array $messages
524 *
525 * @return array
526 */
527 public function updated_messages( $messages ) {
528 global $post_ID;
529
530 if ( $this->bail() ) return $messages;
531
532 // URL for the current forum
533 $forum_url = bbp_get_forum_permalink( $post_ID );
534
535 // Current forum's post_date
536 $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
537
538 // Messages array
539 $messages[$this->post_type] = array(
540 0 => '', // Left empty on purpose
541
542 // Updated
543 1 => sprintf( __( 'Forum updated. <a href="%s">View forum</a>', 'bbpress' ), $forum_url ),
544
545 // Custom field updated
546 2 => __( 'Custom field updated.', 'bbpress' ),
547
548 // Custom field deleted
549 3 => __( 'Custom field deleted.', 'bbpress' ),
550
551 // Forum updated
552 4 => __( 'Forum updated.', 'bbpress' ),
553
554 // Restored from revision
555 // translators: %s: date and time of the revision
556 5 => isset( $_GET['revision'] )
557 ? sprintf( __( 'Forum restored to revision from %s', 'bbpress' ), wp_post_revision_title( (int) $_GET['revision'], false ) )
558 : false,
559
560 // Forum created
561 6 => sprintf( __( 'Forum created. <a href="%s">View forum</a>', 'bbpress' ), $forum_url ),
562
563 // Forum saved
564 7 => __( 'Forum saved.', 'bbpress' ),
565
566 // Forum submitted
567 8 => sprintf( __( 'Forum submitted. <a target="_blank" href="%s">Preview forum</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
568
569 // Forum scheduled
570 9 => sprintf( __( 'Forum scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview forum</a>', 'bbpress' ),
571 // translators: Publish box date format, see http://php.net/date
572 date_i18n( __( 'M j, Y @ G:i', 'bbpress' ),
573 strtotime( $post_date ) ),
574 $forum_url ),
575
576 // Forum draft updated
577 10 => sprintf( __( 'Forum draft updated. <a target="_blank" href="%s">Preview forum</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
578 );
579
580 return $messages;
581 }
582 }
583 endif; // class_exists check
584
585 /**
586 * Setup bbPress Forums Admin
587 *
588 * This is currently here to make hooking and unhooking of the admin UI easy.
589 * It could use dependency injection in the future, but for now this is easier.
590 *
591 * @since bbPress (r2596)
592 *
593 * @uses BBP_Forums_Admin
594 */
595 function bbp_admin_forums() {
596 bbpress()->admin->forums = new BBP_Forums_Admin();
597 }
598