| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* bbPress Loader Actions |
| 5 |
* |
| 6 |
* @package bbPress |
| 7 |
* @subpackage Loader |
| 8 |
*/ |
| 9 |
|
| 10 |
// Redirect if accessed directly |
| 11 |
if ( !defined( 'ABSPATH' ) ) exit; |
| 12 |
|
| 13 |
/** Main Actions **************************************************************/ |
| 14 |
|
| 15 |
/** |
| 16 |
* Main action responsible for constants, globals, and includes |
| 17 |
* |
| 18 |
* @since bbPress (r2599) |
| 19 |
* |
| 20 |
* @uses do_action() Calls 'bbp_loaded' |
| 21 |
*/ |
| 22 |
function bbp_loaded() { |
| 23 |
do_action( 'bbp_loaded' ); |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Setup constants |
| 28 |
* |
| 29 |
* @since bbPress (r2599) |
| 30 |
* |
| 31 |
* @uses do_action() Calls 'bbp_constants' |
| 32 |
*/ |
| 33 |
function bbp_constants() { |
| 34 |
do_action( 'bbp_constants' ); |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Setup globals BEFORE includes |
| 39 |
* |
| 40 |
* @since bbPress (r2599) |
| 41 |
* |
| 42 |
* @uses do_action() Calls 'bbp_boot_strap_globals' |
| 43 |
*/ |
| 44 |
function bbp_boot_strap_globals() { |
| 45 |
do_action( 'bbp_boot_strap_globals' ); |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* Include files |
| 50 |
* |
| 51 |
* @since bbPress (r2599) |
| 52 |
* |
| 53 |
* @uses do_action() Calls 'bbp_includes' |
| 54 |
*/ |
| 55 |
function bbp_includes() { |
| 56 |
do_action( 'bbp_includes' ); |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Setup globals AFTER includes |
| 61 |
* |
| 62 |
* @since bbPress (r2599) |
| 63 |
* |
| 64 |
* @uses do_action() Calls 'bbp_setup_globals' |
| 65 |
*/ |
| 66 |
function bbp_setup_globals() { |
| 67 |
do_action( 'bbp_setup_globals' ); |
| 68 |
} |
| 69 |
|
| 70 |
/** |
| 71 |
* Initialize any code after everything has been loaded |
| 72 |
* |
| 73 |
* @since bbPress (r2599) |
| 74 |
* |
| 75 |
* @uses do_action() Calls 'bbp_init' |
| 76 |
*/ |
| 77 |
function bbp_init() { |
| 78 |
do_action ( 'bbp_init' ); |
| 79 |
} |
| 80 |
|
| 81 |
/** Supplemental Actions ******************************************************/ |
| 82 |
|
| 83 |
/** |
| 84 |
* Setup the currently logged-in user |
| 85 |
* |
| 86 |
* @since bbPress (r2695) |
| 87 |
* |
| 88 |
* @uses do_action() Calls 'bbp_setup_current_user' |
| 89 |
*/ |
| 90 |
function bbp_setup_current_user() { |
| 91 |
do_action ( 'bbp_setup_current_user' ); |
| 92 |
} |
| 93 |
|
| 94 |
/** |
| 95 |
* Load translations for current language |
| 96 |
* |
| 97 |
* @since bbPress (r2599) |
| 98 |
* |
| 99 |
* @uses do_action() Calls 'bbp_load_textdomain' |
| 100 |
*/ |
| 101 |
function bbp_register_textdomain() { |
| 102 |
do_action( 'bbp_load_textdomain' ); |
| 103 |
} |
| 104 |
|
| 105 |
/** |
| 106 |
* Sets up the theme directory |
| 107 |
* |
| 108 |
* @since bbPress (r2507) |
| 109 |
* |
| 110 |
* @uses do_action() Calls 'bbp_register_theme_directory' |
| 111 |
*/ |
| 112 |
function bbp_register_theme_directory() { |
| 113 |
do_action( 'bbp_register_theme_directory' ); |
| 114 |
} |
| 115 |
|
| 116 |
/** |
| 117 |
* Setup the post types |
| 118 |
* |
| 119 |
* @since bbPress (r2464) |
| 120 |
* |
| 121 |
* @uses do_action() Calls 'bbp_register_post_type' |
| 122 |
*/ |
| 123 |
function bbp_register_post_types() { |
| 124 |
do_action ( 'bbp_register_post_types' ); |
| 125 |
} |
| 126 |
|
| 127 |
/** |
| 128 |
* Setup the post statuses |
| 129 |
* |
| 130 |
* @since bbPress (r2727) |
| 131 |
* |
| 132 |
* @uses do_action() Calls 'bbp_register_post_statuses' |
| 133 |
*/ |
| 134 |
function bbp_register_post_statuses() { |
| 135 |
do_action ( 'bbp_register_post_statuses' ); |
| 136 |
} |
| 137 |
|
| 138 |
/** |
| 139 |
* Register the built in bbPress taxonomies |
| 140 |
* |
| 141 |
* @since bbPress (r2464) |
| 142 |
* |
| 143 |
* @uses do_action() Calls 'bbp_register_taxonomies' |
| 144 |
*/ |
| 145 |
function bbp_register_taxonomies() { |
| 146 |
do_action ( 'bbp_register_taxonomies' ); |
| 147 |
} |
| 148 |
|
| 149 |
/** |
| 150 |
* Register the default bbPress views |
| 151 |
* |
| 152 |
* @since bbPress (r2789) |
| 153 |
* |
| 154 |
* @uses do_action() Calls 'bbp_register_views' |
| 155 |
*/ |
| 156 |
function bbp_register_views() { |
| 157 |
do_action ( 'bbp_register_views' ); |
| 158 |
} |
| 159 |
|
| 160 |
/** |
| 161 |
* Add the bbPress-specific rewrite tags |
| 162 |
* |
| 163 |
* @since bbPress (r2753) |
| 164 |
* |
| 165 |
* @uses do_action() Calls 'bbp_add_rewrite_tags' |
| 166 |
*/ |
| 167 |
function bbp_add_rewrite_tags() { |
| 168 |
do_action ( 'bbp_add_rewrite_tags' ); |
| 169 |
} |
| 170 |
|
| 171 |
/** |
| 172 |
* Generate bbPress-specific rewrite rules |
| 173 |
* |
| 174 |
* @since bbPress (r2688) |
| 175 |
* |
| 176 |
* @param WP_Rewrite $wp_rewrite |
| 177 |
* |
| 178 |
* @uses do_action() Calls 'bbp_generate_rewrite_rules' with {@link WP_Rewrite} |
| 179 |
*/ |
| 180 |
function bbp_generate_rewrite_rules( $wp_rewrite ) { |
| 181 |
do_action_ref_array( 'bbp_generate_rewrite_rules', array( &$wp_rewrite ) ); |
| 182 |
} |
| 183 |
|
| 184 |
/** |
| 185 |
* Setup bbPress theme compatability actions |
| 186 |
* |
| 187 |
* @since bbPress (r3028) |
| 188 |
* |
| 189 |
* @uses do_action() Calls 'bbp_setup_theme_compat' |
| 190 |
*/ |
| 191 |
function bbp_setup_theme_compat() { |
| 192 |
do_action( 'bbp_setup_theme_compat' ); |
| 193 |
} |
| 194 |
|
| 195 |
/** Final Action **************************************************************/ |
| 196 |
|
| 197 |
/** |
| 198 |
* bbPress has loaded and initialized everything, and is okay to go |
| 199 |
* |
| 200 |
* @since bbPress (r2618) |
| 201 |
* |
| 202 |
* @uses do_action() Calls 'bbp_ready' |
| 203 |
*/ |
| 204 |
function bbp_ready() { |
| 205 |
do_action( 'bbp_ready' ); |
| 206 |
} |
| 207 |
|
| 208 |
?> |
| 209 |
|