PluginProbe
bbPress / 2.0-rc-2
bbPress v2.0-rc-2
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-includes / bbp-core-hooks.php

bbp-core-hooks.php in bbPress 2.0-rc-2, at bbp-includes/bbp-core-hooks.php

630 lines 21.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * bbPress Filters & Actions
5 *
6 * @package bbPress
7 * @subpackage Hooks
8 *
9 * This file contains the actions and filters that are used through-out bbPress.
10 * They are consolidated here to make searching for them easier, and to help
11 * developers understand at a glance the order in which things occur.
12 *
13 * There are a few common places that additional actions can currently be found
14 *
15 * - bbPress: In {@link bbPress::setup_actions()} in bbpress.php
16 * - Component: In {@link BBP_Component::setup_actions()} in
17 * bbp-includes/bbp-classes.php
18 * - Admin: More in {@link BBP_Admin::setup_actions()} in
19 * bbp-admin/bbp-admin.php
20 */
21
22 // Exit if accessed directly
23 if ( !defined( 'ABSPATH' ) ) exit;
24
25 /** ACTIONS *******************************************************************/
26
27 /**
28 * Attach bbPress to WordPress
29 *
30 * bbPress uses its own internal actions to help aid in additional plugin
31 * development, and to limit the amount of potential future code changes when
32 * updates to WordPress occur.
33 */
34 add_action( 'plugins_loaded', 'bbp_loaded', 10 );
35 add_action( 'init', 'bbp_init', 10 );
36 add_action( 'widgets_init', 'bbp_widgets_init', 10 );
37 add_action( 'generate_rewrite_rules', 'bbp_generate_rewrite_rules', 10 );
38 add_action( 'wp_enqueue_scripts', 'bbp_enqueue_scripts', 10 );
39 add_filter( 'template_include', 'bbp_template_include', 10 );
40
41 /**
42 * bbp_loaded - Attached to 'plugins_loaded' above
43 *
44 * Attach various loader actions to the bbp_loaded action.
45 * The load order helps to load code at the correct time.
46 * v---Load order
47 */
48 add_action( 'bbp_loaded', 'bbp_constants', 2 );
49 add_action( 'bbp_loaded', 'bbp_boot_strap_globals', 4 );
50 add_action( 'bbp_loaded', 'bbp_includes', 6 );
51 add_action( 'bbp_loaded', 'bbp_setup_globals', 8 );
52 add_action( 'bbp_loaded', 'bbp_register_theme_directory', 10 );
53
54 /**
55 * bbp_init - Attached to 'init' above
56 *
57 * Attach various initialization actions to the init action.
58 * The load order helps to load code at the correct time.
59 * v---Load order
60 */
61 add_action( 'bbp_init', 'bbp_load_textdomain', 2 );
62 add_action( 'bbp_init', 'bbp_setup_current_user', 4 );
63 add_action( 'bbp_init', 'bbp_setup_theme_compat', 6 );
64 add_action( 'bbp_init', 'bbp_setup_akismet', 8 );
65 add_action( 'bbp_init', 'bbp_setup_buddypress', 10 );
66 add_action( 'bbp_init', 'bbp_register_post_types', 12 );
67 add_action( 'bbp_init', 'bbp_register_post_statuses', 14 );
68 add_action( 'bbp_init', 'bbp_register_taxonomies', 16 );
69 add_action( 'bbp_init', 'bbp_register_views', 18 );
70 add_action( 'bbp_init', 'bbp_register_shortcodes', 20 );
71 add_action( 'bbp_init', 'bbp_add_rewrite_tags', 22 );
72 add_action( 'bbp_init', 'bbp_ready', 999 );
73
74 // Multisite Global Forum Access
75 add_action( 'bbp_setup_current_user', 'bbp_global_access_role_mask', 10 );
76
77 // Theme Compat
78 add_action( 'bbp_enqueue_scripts', 'bbp_theme_compat_enqueue_css', 10 );
79
80 // Widgets
81 add_action( 'bbp_widgets_init', array( 'BBP_Login_Widget', 'register_widget' ), 10 );
82 add_action( 'bbp_widgets_init', array( 'BBP_Views_Widget', 'register_widget' ), 10 );
83 add_action( 'bbp_widgets_init', array( 'BBP_Forums_Widget', 'register_widget' ), 10 );
84 add_action( 'bbp_widgets_init', array( 'BBP_Topics_Widget', 'register_widget' ), 10 );
85 add_action( 'bbp_widgets_init', array( 'BBP_Replies_Widget', 'register_widget' ), 10 );
86
87 // Template - Head, foot, errors and messages
88 add_action( 'wp_head', 'bbp_head' );
89 add_filter( 'wp_title', 'bbp_title', 10, 3 );
90 add_action( 'wp_footer', 'bbp_footer' );
91 add_action( 'bbp_loaded', 'bbp_login_notices' );
92 add_action( 'bbp_head', 'bbp_topic_notices' );
93 add_action( 'bbp_template_notices', 'bbp_template_notices' );
94
95 // Add to body class
96 add_filter( 'body_class', 'bbp_body_class', 10, 2 );
97
98 // Caps & Roles
99 add_filter( 'map_meta_cap', 'bbp_map_meta_caps', 10, 4 );
100 add_action( 'bbp_activation', 'bbp_add_roles', 1 );
101 add_action( 'bbp_activation', 'bbp_add_caps', 2 );
102 add_action( 'bbp_deactivation', 'bbp_remove_caps', 1 );
103 add_action( 'bbp_deactivation', 'bbp_remove_roles', 2 );
104
105 // Options & Settings
106 add_action( 'bbp_activation', 'bbp_add_options', 1 );
107
108 // Multisite
109 add_action( 'bbp_new_site', 'bbp_add_roles', 2 );
110 add_action( 'bbp_new_site', 'bbp_add_caps', 4 );
111 add_action( 'bbp_new_site', 'bbp_add_options', 6 );
112
113 // Topic Tag Page
114 add_action( 'template_redirect', 'bbp_manage_topic_tag_handler', 1 );
115
116 // Before and After the Query
117 add_action( 'pre_get_posts', 'bbp_pre_get_posts', 2 );
118 add_action( 'pre_get_posts', 'bbp_pre_get_posts_exclude_forums', 4 );
119 add_action( 'template_redirect', 'bbp_forum_visibility_check', -1 );
120
121 // Profile Edit
122 add_action( 'template_redirect', 'bbp_edit_user_handler', 1 );
123
124 // Profile Page Messages
125 add_action( 'bbp_template_notices', 'bbp_notice_edit_user_success' );
126 add_action( 'bbp_template_notices', 'bbp_notice_edit_user_is_super_admin', 2 );
127
128 // Update forum branch
129 add_action( 'bbp_trashed_forum', 'bbp_update_forum_walker' );
130 add_action( 'bbp_untrashed_forum', 'bbp_update_forum_walker' );
131 add_action( 'bbp_deleted_forum', 'bbp_update_forum_walker' );
132 add_action( 'bbp_spammed_forum', 'bbp_update_forum_walker' );
133 add_action( 'bbp_unspammed_forum', 'bbp_update_forum_walker' );
134
135 // New/Edit Reply
136 add_action( 'template_redirect', 'bbp_new_reply_handler' );
137 add_action( 'template_redirect', 'bbp_edit_reply_handler', 1 );
138 add_action( 'bbp_new_reply', 'bbp_update_reply', 10, 6 );
139 add_action( 'bbp_edit_reply', 'bbp_update_reply', 10, 6 );
140
141 // Before Delete/Trash/Untrash Reply
142 add_action( 'trash_post', 'bbp_trash_reply' );
143 add_action( 'untrash_post', 'bbp_untrash_reply' );
144 add_action( 'delete_post', 'bbp_delete_reply' );
145
146 // After Deleted/Trashed/Untrashed Reply
147 add_action( 'trashed_post', 'bbp_trashed_reply' );
148 add_action( 'untrashed_post', 'bbp_untrashed_reply' );
149 add_action( 'deleted_post', 'bbp_deleted_reply' );
150
151 // New/Edit Topic
152 add_action( 'template_redirect', 'bbp_new_topic_handler' );
153 add_action( 'template_redirect', 'bbp_edit_topic_handler', 1 );
154 add_action( 'bbp_new_topic', 'bbp_update_topic', 10, 5 );
155 add_action( 'bbp_edit_topic', 'bbp_update_topic', 10, 5 );
156
157 // Split/Merge Topic
158 add_action( 'template_redirect', 'bbp_merge_topic_handler', 1 );
159 add_action( 'template_redirect', 'bbp_split_topic_handler', 1 );
160 add_action( 'bbp_merged_topic', 'bbp_merge_topic_count', 1, 3 );
161 add_action( 'bbp_post_split_topic', 'bbp_split_topic_count', 1, 3 );
162
163 // Before Delete/Trash/Untrash Topic
164 add_action( 'trash_post', 'bbp_trash_topic' );
165 add_action( 'untrash_post', 'bbp_untrash_topic' );
166 add_action( 'delete_post', 'bbp_delete_topic' );
167
168 // After Deleted/Trashed/Untrashed Topic
169 add_action( 'trashed_post', 'bbp_trashed_topic' );
170 add_action( 'untrashed_post', 'bbp_untrashed_topic' );
171 add_action( 'deleted_post', 'bbp_deleted_topic' );
172
173 // Topic/Reply Actions
174 add_action( 'template_redirect', 'bbp_toggle_topic_handler', 1 );
175 add_action( 'template_redirect', 'bbp_toggle_reply_handler', 1 );
176
177 // Favorites
178 add_action( 'template_redirect', 'bbp_favorites_handler', 1 );
179 add_action( 'bbp_trash_topic', 'bbp_remove_topic_from_all_favorites' );
180 add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_favorites' );
181
182 // Subscriptions
183 add_action( 'template_redirect', 'bbp_subscriptions_handler', 1 );
184 add_action( 'bbp_trash_topic', 'bbp_remove_topic_from_all_subscriptions' );
185 add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_subscriptions' );
186 add_action( 'bbp_new_reply', 'bbp_notify_subscribers', 1, 1 );
187
188 // Sticky
189 add_action( 'bbp_trash_topic', 'bbp_unstick_topic' );
190 add_action( 'bbp_delete_topic', 'bbp_unstick_topic' );
191
192 // Update topic branch
193 add_action( 'bbp_trashed_topic', 'bbp_update_topic_walker' );
194 add_action( 'bbp_untrashed_topic', 'bbp_update_topic_walker' );
195 add_action( 'bbp_deleted_topic', 'bbp_update_topic_walker' );
196 add_action( 'bbp_spammed_topic', 'bbp_update_topic_walker' );
197 add_action( 'bbp_unspammed_topic', 'bbp_update_topic_walker' );
198
199 // Update reply branch
200 add_action( 'bbp_trashed_reply', 'bbp_update_reply_walker' );
201 add_action( 'bbp_untrashed_reply', 'bbp_update_reply_walker' );
202 add_action( 'bbp_deleted_reply', 'bbp_update_reply_walker' );
203 add_action( 'bbp_spammed_reply', 'bbp_update_reply_walker' );
204 add_action( 'bbp_unspammed_reply', 'bbp_update_reply_walker' );
205
206 /**
207 * When a new site is created in a multisite installation, run the activation
208 * routine on that site
209 *
210 * @since bbPress (r3283)
211 *
212 * @param int $blog_id
213 * @param int $user_id
214 * @param string $domain
215 * @param string $path
216 * @param int $site_id
217 * @param array() $meta
218 */
219 function bbp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
220
221 // Switch to the new blog
222 switch_to_blog( $blog_id );
223
224 // Do the bbPress activation routine
225 do_action( 'bbp_new_site' );
226
227 // restore original blog
228 restore_current_blog();
229 }
230 add_action( 'wpmu_new_blog', 'bbp_new_site', 10, 6 );
231
232 /** FILTERS *******************************************************************/
233
234 /**
235 * Template Compatibility
236 *
237 * If you want to completely bypass this and manage your own custom bbPress
238 * template hierarchy, start here by removing this filter, then look at how
239 * bbp_template_include() works and do something similar. :)
240 */
241 add_filter( 'bbp_template_include', 'bbp_template_include_theme_supports', 2, 1 );
242 add_filter( 'bbp_template_include', 'bbp_template_include_theme_compat', 4, 2 );
243
244 /**
245 * Feeds
246 *
247 * bbPress comes with a number of custom RSS2 feeds that get handled outside
248 * the normal scope of feeds that WordPress would normally serve. To do this,
249 * we filter every page request, listen for a feed request, and trap it.
250 */
251 add_filter( 'request', 'bbp_request_feed_trap' );
252
253 // Links
254 add_filter( 'paginate_links', 'bbp_add_view_all' );
255 add_filter( 'bbp_get_topic_permalink', 'bbp_add_view_all' );
256 add_filter( 'bbp_get_reply_permalink', 'bbp_add_view_all' );
257 add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
258
259 // wp_filter_kses on new/edit topic/reply title
260 add_filter( 'bbp_new_reply_pre_title', 'wp_filter_kses' );
261 add_filter( 'bbp_new_topic_pre_title', 'wp_filter_kses' );
262 add_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' );
263 add_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' );
264
265 // balanceTags, wp_filter_kses and wp_rel_nofollow on new/edit topic/reply text
266 add_filter( 'bbp_new_reply_pre_content', 'balanceTags' );
267 add_filter( 'bbp_new_reply_pre_content', 'wp_rel_nofollow' );
268 add_filter( 'bbp_new_reply_pre_content', 'wp_filter_kses' );
269 add_filter( 'bbp_new_topic_pre_content', 'balanceTags' );
270 add_filter( 'bbp_new_topic_pre_content', 'wp_rel_nofollow' );
271 add_filter( 'bbp_new_topic_pre_content', 'wp_filter_kses' );
272 add_filter( 'bbp_edit_reply_pre_content', 'balanceTags' );
273 add_filter( 'bbp_edit_reply_pre_content', 'wp_rel_nofollow' );
274 add_filter( 'bbp_edit_reply_pre_content', 'wp_filter_kses' );
275 add_filter( 'bbp_edit_topic_pre_content', 'balanceTags' );
276 add_filter( 'bbp_edit_topic_pre_content', 'wp_rel_nofollow' );
277 add_filter( 'bbp_edit_topic_pre_content', 'wp_filter_kses' );
278
279 // Add number format filter to functions requiring numeric output
280 add_filter( 'bbp_get_forum_topic_count', 'bbp_number_format' );
281 add_filter( 'bbp_get_forum_topic_reply_count', 'bbp_number_format' );
282
283 // No follow and stripslashes on user profile links
284 add_filter( 'bbp_get_reply_author_link', 'wp_rel_nofollow' );
285 add_filter( 'bbp_get_reply_author_link', 'stripslashes' );
286 add_filter( 'bbp_get_topic_author_link', 'wp_rel_nofollow' );
287 add_filter( 'bbp_get_topic_author_link', 'stripslashes' );
288 add_filter( 'bbp_get_user_favorites_link', 'wp_rel_nofollow' );
289 add_filter( 'bbp_get_user_favorites_link', 'stripslashes' );
290 add_filter( 'bbp_get_user_subscribe_link', 'wp_rel_nofollow' );
291 add_filter( 'bbp_get_user_subscribe_link', 'stripslashes' );
292 add_filter( 'bbp_get_user_profile_link', 'wp_rel_nofollow' );
293 add_filter( 'bbp_get_user_profile_link', 'stripslashes' );
294 add_filter( 'bbp_get_user_profile_edit_link', 'wp_rel_nofollow' );
295 add_filter( 'bbp_get_user_profile_edit_link', 'stripslashes' );
296
297 // Run filters on reply content
298 add_filter( 'bbp_get_reply_content', 'capital_P_dangit' );
299 add_filter( 'bbp_get_reply_content', 'wptexturize', 3 );
300 add_filter( 'bbp_get_reply_content', 'convert_chars', 5 );
301 add_filter( 'bbp_get_reply_content', 'make_clickable', 9 );
302 add_filter( 'bbp_get_reply_content', 'force_balance_tags', 25 );
303 add_filter( 'bbp_get_reply_content', 'convert_smilies', 20 );
304 add_filter( 'bbp_get_reply_content', 'wpautop', 30 );
305
306 // Run filters on topic content
307 add_filter( 'bbp_get_topic_content', 'capital_P_dangit' );
308 add_filter( 'bbp_get_topic_content', 'wptexturize', 3 );
309 add_filter( 'bbp_get_topic_content', 'convert_chars', 5 );
310 add_filter( 'bbp_get_topic_content', 'make_clickable', 9 );
311 add_filter( 'bbp_get_topic_content', 'force_balance_tags', 25 );
312 add_filter( 'bbp_get_topic_content', 'convert_smilies', 20 );
313 add_filter( 'bbp_get_topic_content', 'wpautop', 30 );
314
315 // Revisions
316 add_filter( 'bbp_get_reply_content', 'bbp_reply_content_append_revisions', 1, 2 );
317 add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions', 1, 2 );
318
319 // Canonical
320 add_filter( 'redirect_canonical', 'bbp_redirect_canonical' );
321
322 // Login/Register/Lost Password
323 add_filter( 'login_redirect', 'bbp_redirect_login', 2, 3 );
324 add_filter( 'logout_url', 'bbp_logout_url', 2, 2 );
325
326 // Fix post author id for anonymous posts (set it back to 0) when the post status is changed
327 add_filter( 'wp_insert_post_data', 'bbp_fix_post_author', 30, 2 );
328
329 // Suppress private forum details
330 add_filter( 'bbp_get_forum_topic_count', 'bbp_suppress_private_forum_meta', 10, 2 );
331 add_filter( 'bbp_get_forum_reply_count', 'bbp_suppress_private_forum_meta', 10, 2 );
332 add_filter( 'bbp_get_forum_post_count', 'bbp_suppress_private_forum_meta', 10, 2 );
333 add_filter( 'bbp_get_forum_freshness_link', 'bbp_suppress_private_forum_meta', 10, 2 );
334 add_filter( 'bbp_get_author_link', 'bbp_suppress_private_author_link', 10, 2 );
335 add_filter( 'bbp_get_topic_author_link', 'bbp_suppress_private_author_link', 10, 2 );
336 add_filter( 'bbp_get_reply_author_link', 'bbp_suppress_private_author_link', 10, 2 );
337
338 /**
339 * Add filters to anonymous post author data
340 *
341 * This is used to clean-up any anonymous user data that is submitted via the
342 * new topic and new reply forms.
343 *
344 * @uses add_filter() To add filters
345 */
346 function bbp_pre_anonymous_filters () {
347
348 // Post author name
349 $filters = array(
350 'trim' => 10,
351 'sanitize_text_field' => 10,
352 'wp_filter_kses' => 10,
353 '_wp_specialchars' => 30
354 );
355 foreach ( $filters as $filter => $priority )
356 add_filter( 'bbp_pre_anonymous_post_author_name', $filter, $priority );
357
358 // Email saves
359 foreach ( array( 'trim', 'sanitize_email', 'wp_filter_kses' ) as $filter )
360 add_filter( 'bbp_pre_anonymous_post_author_email', $filter );
361
362 // Save URL
363 foreach ( array( 'trim', 'wp_strip_all_tags', 'esc_url_raw', 'wp_filter_kses' ) as $filter )
364 add_filter( 'bbp_pre_anonymous_post_author_website', $filter );
365 }
366 bbp_pre_anonymous_filters();
367
368 /**
369 * On multisite installations you must first allow themes to be activated and
370 * show up on the theme selection screen. This function will let the bbPress
371 * bundled themes show up and bypass this step.
372 *
373 * @since bbPress (r2944)
374 *
375 * @uses apply_filters() Calls 'bbp_allowed_themes' with the allowed themes list
376 */
377 function bbp_allowed_themes( $themes ) {
378 $themes['bbp-twentyten'] = 1;
379
380 return apply_filters( 'bbp_allowed_themes', $themes );
381 }
382 add_filter( 'allowed_themes', 'bbp_allowed_themes' );
383
384 /** Admin *********************************************************************/
385
386 if ( is_admin() ) {
387
388 /** Actions ***************************************************************/
389
390 add_action( 'bbp_init', 'bbp_admin' );
391 add_action( 'bbp_admin_init', 'bbp_admin_forums', 9 );
392 add_action( 'bbp_admin_init', 'bbp_admin_topics', 9 );
393 add_action( 'bbp_admin_init', 'bbp_admin_replies', 9 );
394 add_action( 'bbp_admin_init', 'bbp_admin_settings_help' );
395 add_action( 'admin_menu', 'bbp_admin_separator' );
396 add_action( 'custom_menu_order', 'bbp_admin_custom_menu_order' );
397 add_action( 'menu_order', 'bbp_admin_menu_order' );
398
399 /** Filters ***************************************************************/
400
401 // Run wp_kses_data on topic/reply content in admin section
402 add_filter( 'bbp_get_reply_content', 'wp_kses_data' );
403 add_filter( 'bbp_get_topic_content', 'wp_kses_data' );
404 }
405
406 /** Main Actions **************************************************************/
407
408 /**
409 * Main action responsible for constants, globals, and includes
410 *
411 * @since bbPress (r2599)
412 *
413 * @uses do_action() Calls 'bbp_loaded'
414 */
415 function bbp_loaded() {
416 do_action( 'bbp_loaded' );
417 }
418
419 /**
420 * Setup constants
421 *
422 * @since bbPress (r2599)
423 *
424 * @uses do_action() Calls 'bbp_constants'
425 */
426 function bbp_constants() {
427 do_action( 'bbp_constants' );
428 }
429
430 /**
431 * Setup globals BEFORE includes
432 *
433 * @since bbPress (r2599)
434 *
435 * @uses do_action() Calls 'bbp_boot_strap_globals'
436 */
437 function bbp_boot_strap_globals() {
438 do_action( 'bbp_boot_strap_globals' );
439 }
440
441 /**
442 * Include files
443 *
444 * @since bbPress (r2599)
445 *
446 * @uses do_action() Calls 'bbp_includes'
447 */
448 function bbp_includes() {
449 do_action( 'bbp_includes' );
450 }
451
452 /**
453 * Setup globals AFTER includes
454 *
455 * @since bbPress (r2599)
456 *
457 * @uses do_action() Calls 'bbp_setup_globals'
458 */
459 function bbp_setup_globals() {
460 do_action( 'bbp_setup_globals' );
461 }
462
463 /**
464 * Initialize any code after everything has been loaded
465 *
466 * @since bbPress (r2599)
467 *
468 * @uses do_action() Calls 'bbp_init'
469 */
470 function bbp_init() {
471 do_action ( 'bbp_init' );
472 }
473
474 /**
475 * Initialize widgets
476 *
477 * @since bbPress (r3389)
478 *
479 * @uses do_action() Calls 'bbp_widgets_init'
480 */
481 function bbp_widgets_init() {
482 do_action ( 'bbp_widgets_init' );
483 }
484
485 /** Supplemental Actions ******************************************************/
486
487 /**
488 * Setup the currently logged-in user
489 *
490 * @since bbPress (r2695)
491 *
492 * @uses do_action() Calls 'bbp_setup_current_user'
493 */
494 function bbp_setup_current_user() {
495 do_action ( 'bbp_setup_current_user' );
496 }
497
498 /**
499 * Load translations for current language
500 *
501 * @since bbPress (r2599)
502 *
503 * @uses do_action() Calls 'bbp_load_textdomain'
504 */
505 function bbp_load_textdomain() {
506 do_action( 'bbp_load_textdomain' );
507 }
508
509 /**
510 * Sets up the theme directory
511 *
512 * @since bbPress (r2507)
513 *
514 * @uses do_action() Calls 'bbp_register_theme_directory'
515 */
516 function bbp_register_theme_directory() {
517 do_action( 'bbp_register_theme_directory' );
518 }
519
520 /**
521 * Setup the post types
522 *
523 * @since bbPress (r2464)
524 *
525 * @uses do_action() Calls 'bbp_register_post_type'
526 */
527 function bbp_register_post_types() {
528 do_action ( 'bbp_register_post_types' );
529 }
530
531 /**
532 * Setup the post statuses
533 *
534 * @since bbPress (r2727)
535 *
536 * @uses do_action() Calls 'bbp_register_post_statuses'
537 */
538 function bbp_register_post_statuses() {
539 do_action ( 'bbp_register_post_statuses' );
540 }
541
542 /**
543 * Register the built in bbPress taxonomies
544 *
545 * @since bbPress (r2464)
546 *
547 * @uses do_action() Calls 'bbp_register_taxonomies'
548 */
549 function bbp_register_taxonomies() {
550 do_action ( 'bbp_register_taxonomies' );
551 }
552
553 /**
554 * Register the default bbPress views
555 *
556 * @since bbPress (r2789)
557 *
558 * @uses do_action() Calls 'bbp_register_views'
559 */
560 function bbp_register_views() {
561 do_action ( 'bbp_register_views' );
562 }
563
564 /**
565 * Enqueue bbPress specific CSS and JS
566 *
567 * @since bbPress (r3373)
568 *
569 * @uses do_action() Calls 'bbp_enqueue_scripts'
570 */
571 function bbp_enqueue_scripts() {
572 do_action ( 'bbp_enqueue_scripts' );
573 }
574
575 /**
576 * Add the bbPress-specific rewrite tags
577 *
578 * @since bbPress (r2753)
579 *
580 * @uses do_action() Calls 'bbp_add_rewrite_tags'
581 */
582 function bbp_add_rewrite_tags() {
583 do_action ( 'bbp_add_rewrite_tags' );
584 }
585
586 /**
587 * Generate bbPress-specific rewrite rules
588 *
589 * @since bbPress (r2688)
590 *
591 * @param WP_Rewrite $wp_rewrite
592 *
593 * @uses do_action() Calls 'bbp_generate_rewrite_rules' with {@link WP_Rewrite}
594 */
595 function bbp_generate_rewrite_rules( $wp_rewrite ) {
596 do_action_ref_array( 'bbp_generate_rewrite_rules', array( &$wp_rewrite ) );
597 }
598
599 /** Final Action **************************************************************/
600
601 /**
602 * bbPress has loaded and initialized everything, and is okay to go
603 *
604 * @since bbPress (r2618)
605 *
606 * @uses do_action() Calls 'bbp_ready'
607 */
608 function bbp_ready() {
609 do_action( 'bbp_ready' );
610 }
611
612 /** Theme Compatibility Filter ************************************************/
613
614 /**
615 * The main filter used for theme compatibility and displaying custom bbPress
616 * theme files.
617 *
618 * @since bbPress (r3311)
619 *
620 * @uses apply_filters()
621 *
622 * @param string $template
623 * @return string Template file to use
624 */
625 function bbp_template_include( $template = '' ) {
626 return apply_filters( 'bbp_template_include', $template );
627 }
628
629 ?>
630