PluginProbe
bbPress / 2.1-beta-1
bbPress v2.1-beta-1
2.6.17 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 All 72 releases
bbpress / bbp-admin / bbp-forums.php

bbp-forums.php in bbPress 2.1-beta-1, at bbp-admin/bbp-forums.php

592 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 var $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 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 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 * Admin globals
84 *
85 * @since bbPress (r2646)
86 * @access private
87 */
88 function setup_globals() {
89
90 // Setup the post type for this admin component
91 $this->post_type = bbp_get_forum_post_type();
92 }
93
94 /** Contextual Help *******************************************************/
95
96 /**
97 * Contextual help for bbPress forum edit page
98 *
99 * @since bbPress (r3119)
100 * @uses get_current_screen()
101 */
102 public function edit_help() {
103
104 $current_screen = get_current_screen();
105 $post_type = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
106
107 // Bail if current screen could not be found
108 if ( empty( $current_screen ) )
109 return;
110
111 // Bail if not the forum post type
112 if ( $post_type != $this->post_type )
113 return;
114
115 // Overview
116 $current_screen->add_help_tab( array(
117 'id' => 'overview',
118 'title' => __( 'Overview', 'bbpress' ),
119 'content' =>
120 '<p>' . __( 'This screen provides access to all of your replies. You can customize the display of this screen to suit your workflow.', 'bbpress' ) . '</p>'
121 ) );
122
123 // Screen Content
124 $current_screen->add_help_tab( array(
125 'id' => 'screen-content',
126 'title' => __( 'Screen Content', 'bbpress' ),
127 'content' =>
128 '<p>' . __( 'You can customize the display of this screen&#8217;s contents in a number of ways:' ) . '</p>' .
129 '<ul>' .
130 '<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>' .
131 '<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>' .
132 '<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>' .
133 '<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>' .
134 '</ul>'
135 ) );
136
137 // Available Actions
138 $current_screen->add_help_tab( array(
139 'id' => 'action-links',
140 'title' => __( 'Available Actions', 'bbpress' ),
141 'content' =>
142 '<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>' .
143 '<ul>' .
144 '<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>' .
145 //'<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>' .
146 '<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>' .
147 '<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>' .
148 '<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>' .
149 '</ul>'
150 ) );
151
152 // Bulk Actions
153 $current_screen->add_help_tab( array(
154 'id' => 'bulk-actions',
155 'title' => __( 'Bulk Actions', 'bbpress' ),
156 'content' =>
157 '<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>' .
158 '<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>'
159 ) );
160
161 // Help Sidebar
162 $current_screen->set_help_sidebar(
163 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
164 '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
165 '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
166 );
167 }
168
169 /**
170 * Contextual help for bbPress forum edit page
171 *
172 * @since bbPress (r3119)
173 * @uses get_current_screen()
174 */
175 public function new_help() {
176
177 $current_screen = get_current_screen();
178 $post_type = !empty( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : '';
179
180 // Bail if current screen could not be found
181 if ( empty( $current_screen ) )
182 return;
183
184 // Bail if not the forum post type
185 if ( $post_type != $this->post_type )
186 return;
187
188 $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>';
189
190 $current_screen->add_help_tab( array(
191 'id' => 'customize-display',
192 'title' => __( 'Customizing This Display', 'bbpress' ),
193 'content' => $customize_display,
194 ) );
195
196 $current_screen->add_help_tab( array(
197 'id' => 'title-forum-editor',
198 'title' => __( 'Title and Forum Editor', 'bbpress' ),
199 'content' =>
200 '<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>' .
201 '<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>'
202 ) );
203
204 $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>';
205
206 if ( current_theme_supports( 'forum-formats' ) && forum_type_supports( 'forum', 'forum-formats' ) ) {
207 $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>';
208 }
209
210 if ( current_theme_supports( 'forum-thumbnails' ) && forum_type_supports( 'forum', 'thumbnail' ) ) {
211 $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>';
212 }
213
214 $current_screen->add_help_tab( array(
215 'id' => 'forum-attributes',
216 'title' => __( 'Forum Attributes', 'bbpress' ),
217 'content' =>
218 '<p>' . __( 'Select the attributes that your forum should have:', 'bbpress' ) . '</p>' .
219 '<ul>' .
220 '<li>' . __( '<strong>Type</strong> indicates if the forum is a category or forum. Categories generally contain other forums.', 'bbpress' ) . '</li>' .
221 '<li>' . __( '<strong>Status</strong> allows you to close a forum to new topics and replies.', 'bbpress' ) . '</li>' .
222 '<li>' . __( '<strong>Visibility</strong> lets you pick the scope of each forum and what users are allowed to access it.', 'bbpress' ) . '</li>' .
223 '<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>' .
224 '<li>' . __( '<strong>Order</strong> allows you to order your forums numerically.', 'bbpress' ) . '</li>' .
225 '</ul>'
226 ) );
227
228 $current_screen->add_help_tab( array(
229 'id' => 'publish-box',
230 'title' => __( 'Publish Box', 'bbpress' ),
231 'content' => $publish_box,
232 ) );
233
234 $current_screen->add_help_tab( array(
235 'id' => 'discussion-settings',
236 'title' => __( 'Discussion Settings', 'bbpress' ),
237 'content' =>
238 '<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>' .
239 '<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>'
240 ) );
241
242 $current_screen->set_help_sidebar(
243 '<p><strong>' . __( 'For more information:', 'bbpress' ) . '</strong></p>' .
244 '<p>' . __( '<a href="http://bbpress.org/documentation/" target="_blank">bbPress Documentation</a>', 'bbpress' ) . '</p>' .
245 '<p>' . __( '<a href="http://bbpress.org/forums/" target="_blank">bbPress Support Forums</a>', 'bbpress' ) . '</p>'
246 );
247 }
248
249 /**
250 * Add the forum attributes metabox
251 *
252 * @since bbPress (r2746)
253 *
254 * @uses bbp_get_forum_post_type() To get the forum post type
255 * @uses add_meta_box() To add the metabox
256 * @uses do_action() Calls 'bbp_forum_attributes_metabox'
257 */
258 function attributes_metabox() {
259 add_meta_box (
260 'bbp_forum_attributes',
261 __( 'Forum Attributes', 'bbpress' ),
262 'bbp_forum_metabox',
263 $this->post_type,
264 'side',
265 'high'
266 );
267
268 do_action( 'bbp_forum_attributes_metabox' );
269 }
270
271 /**
272 * Pass the forum attributes for processing
273 *
274 * @since bbPress (r2746)
275 *
276 * @param int $forum_id Forum id
277 * @uses current_user_can() To check if the current user is capable of
278 * editing the forum
279 * @uses bbp_get_forum() To get the forum
280 * @uses bbp_is_forum_closed() To check if the forum is closed
281 * @uses bbp_is_forum_category() To check if the forum is a category
282 * @uses bbp_is_forum_private() To check if the forum is private
283 * @uses bbp_close_forum() To close the forum
284 * @uses bbp_open_forum() To open the forum
285 * @uses bbp_categorize_forum() To make the forum a category
286 * @uses bbp_normalize_forum() To make the forum normal (not category)
287 * @uses bbp_privatize_forum() To mark the forum as private
288 * @uses bbp_publicize_forum() To mark the forum as public
289 * @uses do_action() Calls 'bbp_forum_attributes_metabox_save' with the
290 * forum id
291 * @return int Forum id
292 */
293 function attributes_metabox_save( $forum_id ) {
294
295 // Bail if doing an autosave
296 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
297 return $forum_id;
298
299 // Bail if not a post request
300 if ( 'POST' != strtoupper( $_SERVER['REQUEST_METHOD'] ) )
301 return $forum_id;
302
303 // Nonce check
304 if ( empty( $_POST['bbp_forum_metabox'] ) || !wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) )
305 return $forum_id;
306
307 // Bail if current user cannot edit this forum
308 if ( !current_user_can( 'edit_forum', $forum_id ) )
309 return $forum_id;
310
311 // Bail if post_type is not a topic or reply
312 if ( get_post_type( $forum_id ) != $this->post_type )
313 return $forum_id;
314
315 // Parent ID
316 $parent_id = ( !empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0;
317
318 // Update the forum meta bidness
319 bbp_update_forum( array(
320 'forum_id' => $forum_id,
321 'post_parent' => (int) $parent_id
322 ) );
323
324 do_action( 'bbp_forum_attributes_metabox_save', $forum_id );
325
326 return $forum_id;
327 }
328
329 /**
330 * Add some general styling to the admin area
331 *
332 * @since bbPress (r2464)
333 *
334 * @uses bbp_get_forum_post_type() To get the forum post type
335 * @uses bbp_get_topic_post_type() To get the topic post type
336 * @uses bbp_get_reply_post_type() To get the reply post type
337 * @uses sanitize_html_class() To sanitize the classes
338 * @uses do_action() Calls 'bbp_admin_head'
339 */
340 function admin_head() {
341
342 if ( get_post_type() == $this->post_type ) : ?>
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 endif; ?>
405
406 <?php
407 }
408
409 /**
410 * Manage the column headers for the forums page
411 *
412 * @since bbPress (r2485)
413 *
414 * @param array $columns The columns
415 * @uses apply_filters() Calls 'bbp_admin_forums_column_headers' with
416 * the columns
417 * @return array $columns bbPress forum columns
418 */
419 function column_headers( $columns ) {
420 $columns = array (
421 'cb' => '<input type="checkbox" />',
422 'title' => __( 'Forum', 'bbpress' ),
423 'bbp_forum_topic_count' => __( 'Topics', 'bbpress' ),
424 'bbp_forum_reply_count' => __( 'Replies', 'bbpress' ),
425 'author' => __( 'Creator', 'bbpress' ),
426 'bbp_forum_created' => __( 'Created' , 'bbpress' ),
427 'bbp_forum_freshness' => __( 'Freshness', 'bbpress' )
428 );
429
430 return apply_filters( 'bbp_admin_forums_column_headers', $columns );
431 }
432
433 /**
434 * Print extra columns for the forums page
435 *
436 * @since bbPress (r2485)
437 *
438 * @param string $column Column
439 * @param int $forum_id Forum id
440 * @uses bbp_forum_topic_count() To output the forum topic count
441 * @uses bbp_forum_reply_count() To output the forum reply count
442 * @uses get_the_date() Get the forum creation date
443 * @uses get_the_time() Get the forum creation time
444 * @uses esc_attr() To sanitize the forum creation time
445 * @uses bbp_get_forum_last_active_time() To get the time when the forum was
446 * last active
447 * @uses do_action() Calls 'bbp_admin_forums_column_data' with the
448 * column and forum id
449 */
450 function column_data( $column, $forum_id ) {
451 switch ( $column ) {
452 case 'bbp_forum_topic_count' :
453 bbp_forum_topic_count( $forum_id );
454 break;
455
456 case 'bbp_forum_reply_count' :
457 bbp_forum_reply_count( $forum_id );
458 break;
459
460 case 'bbp_forum_created':
461 printf( __( '%1$s <br /> %2$s', 'bbpress' ),
462 get_the_date(),
463 esc_attr( get_the_time() )
464 );
465
466 break;
467
468 case 'bbp_forum_freshness' :
469 $last_active = bbp_get_forum_last_active_time( $forum_id, false );
470 if ( !empty( $last_active ) )
471 echo $last_active;
472 else
473 _e( 'No Topics', 'bbpress' );
474
475 break;
476
477 default:
478 do_action( 'bbp_admin_forums_column_data', $column, $forum_id );
479 break;
480 }
481 }
482
483 /**
484 * Forum Row actions
485 *
486 * Remove the quick-edit action link and display the description under
487 * the forum title
488 *
489 * @since bbPress (r2577)
490 *
491 * @param array $actions Actions
492 * @param array $forum Forum object
493 * @uses the_content() To output forum description
494 * @return array $actions Actions
495 */
496 function row_actions( $actions, $forum ) {
497 if ( $forum->post_type == $this->post_type ) {
498 unset( $actions['inline hide-if-no-js'] );
499
500 // simple hack to show the forum description under the title
501 bbp_forum_content( $forum->ID );
502 }
503
504 return $actions;
505 }
506
507 /**
508 * Custom user feedback messages for forum post type
509 *
510 * @since bbPress (r3080)
511 *
512 * @global int $post_ID
513 * @uses get_post_type()
514 * @uses bbp_get_forum_permalink()
515 * @uses wp_post_revision_title()
516 * @uses esc_url()
517 * @uses add_query_arg()
518 *
519 * @param array $messages
520 *
521 * @return array
522 */
523 function updated_messages( $messages ) {
524 global $post_ID;
525
526 if ( get_post_type( $post_ID ) != $this->post_type )
527 return $messages;
528
529 // URL for the current forum
530 $forum_url = bbp_get_forum_permalink( $post_ID );
531
532 // Current forum's post_date
533 $post_date = bbp_get_global_post_field( 'post_date', 'raw' );
534
535 // Messages array
536 $messages[$this->post_type] = array(
537 0 => '', // Left empty on purpose
538
539 // Updated
540 1 => sprintf( __( 'Forum updated. <a href="%s">View forum</a>' ), $forum_url ),
541
542 // Custom field updated
543 2 => __( 'Custom field updated.', 'bbpress' ),
544
545 // Custom field deleted
546 3 => __( 'Custom field deleted.', 'bbpress' ),
547
548 // Forum updated
549 4 => __( 'Forum updated.', 'bbpress' ),
550
551 // Restored from revision
552 // translators: %s: date and time of the revision
553 5 => isset( $_GET['revision'] )
554 ? sprintf( __( 'Forum restored to revision from %s', 'bbpress' ), wp_post_revision_title( (int) $_GET['revision'], false ) )
555 : false,
556
557 // Forum created
558 6 => sprintf( __( 'Forum created. <a href="%s">View forum</a>', 'bbpress' ), $forum_url ),
559
560 // Forum saved
561 7 => __( 'Forum saved.', 'bbpress' ),
562
563 // Forum submitted
564 8 => sprintf( __( 'Forum submitted. <a target="_blank" href="%s">Preview forum</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
565
566 // Forum scheduled
567 9 => sprintf( __( 'Forum scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview forum</a>', 'bbpress' ),
568 // translators: Publish box date format, see http://php.net/date
569 date_i18n( __( 'M j, Y @ G:i' ),
570 strtotime( $post_date ) ),
571 $forum_url ),
572
573 // Forum draft updated
574 10 => sprintf( __( 'Forum draft updated. <a target="_blank" href="%s">Preview forum</a>', 'bbpress' ), esc_url( add_query_arg( 'preview', 'true', $forum_url ) ) ),
575 );
576
577 return $messages;
578 }
579 }
580 endif; // class_exists check
581
582 /**
583 * Setup bbPress Forums Admin
584 *
585 * @since bbPress (r2596)
586 *
587 * @uses BBP_Forums_Admin
588 */
589 function bbp_admin_forums() {
590 bbpress()->admin->forums = new BBP_Forums_Admin();
591 }
592