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

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