Changeset 2753 for branches/plugin/bbp-includes/bbp-loader.php
- Timestamp:
- 01/05/2011 06:52:36 PM (15 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbp-includes/bbp-loader.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-loader.php
r2727 r2753 1 1 <?php 2 2 3 /** 3 * bbp-loader.php 4 * 5 * The main bbPress loader. Action priorities included for the sake of human 6 * readability and clarification. 4 * The main bbPress loader. 7 5 * 8 6 * @package bbPress 9 7 * @subpackage Loader 10 * @since bbPress (r2464)11 8 */ 12 13 // Attach to WordPress actions14 add_action( 'plugins_loaded', 'bbp_loaded' , 10 );15 add_action( 'init', 'bbp_init' , 10 );16 add_action( 'generate_rewrite_rules', 'bbp_generate_rewrite_rules' , 12 );17 18 // Attach to bbp_loaded.19 add_action( 'bbp_loaded', 'bbp_constants' , 2 );20 add_action( 'bbp_loaded', 'bbp_boot_strap_globals' , 4 );21 add_action( 'bbp_loaded', 'bbp_includes' , 6 );22 add_action( 'bbp_loaded', 'bbp_setup_globals' , 8 );23 add_action( 'bbp_loaded', 'bbp_register_theme_directory' , 10 );24 25 // Attach to bbp_init.26 add_action( 'bbp_init', 'bbp_setup_current_user' , 2 );27 add_action( 'bbp_init', 'bbp_register_post_types' , 4 );28 add_action( 'bbp_init', 'bbp_register_post_statuses' , 6 );29 add_action( 'bbp_init', 'bbp_register_taxonomies' , 8 );30 add_action( 'bbp_init', 'bbp_register_textdomain' , 10 );31 add_action( 'bbp_init', 'bbp_add_user_rewrite_tag' , 12 );32 add_action( 'bbp_init', 'bbp_ready' , 999 );33 9 34 10 /** Main Actions **************************************************************/ 35 11 36 12 /** 37 * bbp_bbp_constants ()13 * Setup constants 38 14 * 39 * Setup constants 15 * @since bbPress (r2599) 16 * 17 * @uses do_action() Calls 'bbp_constants' 40 18 */ 41 function bbp_constants () {19 function bbp_constants() { 42 20 do_action( 'bbp_constants' ); 43 21 } 44 22 45 23 /** 46 * boot_strap_globals ()24 * Setup globals BEFORE includes 47 25 * 48 * Setup globals BEFORE includes 26 * @since bbPress (r2599) 27 * 28 * @uses do_action() Calls 'bbp_boot_strap_globals' 49 29 */ 50 function bbp_boot_strap_globals () {30 function bbp_boot_strap_globals() { 51 31 do_action( 'bbp_boot_strap_globals' ); 52 32 } 53 33 54 34 /** 55 * bbp_includes ()35 * Include files 56 36 * 57 * Include files 37 * @since bbPress (r2599) 38 * 39 * @uses do_action() Calls 'bbp_includes' 58 40 */ 59 function bbp_includes () {41 function bbp_includes() { 60 42 do_action( 'bbp_includes' ); 61 43 } 62 44 63 45 /** 64 * bbp_setup_globals ()46 * Setup globals AFTER includes 65 47 * 66 * Setup globals AFTER includes 48 * @since bbPress (r2599) 49 * 50 * @uses do_action() Calls 'bbp_setup_globals' 67 51 */ 68 function bbp_setup_globals () {52 function bbp_setup_globals() { 69 53 do_action( 'bbp_setup_globals' ); 70 54 } 71 55 72 56 /** 73 * bbp_loaded ()57 * Main action responsible for constants, globals, and includes 74 58 * 75 * Main action responsible for constants, globals, and includes 59 * @since bbPress (r2599) 60 * 61 * @uses do_action() Calls 'bbp_loaded' 76 62 */ 77 function bbp_loaded () {63 function bbp_loaded() { 78 64 do_action( 'bbp_loaded' ); 79 65 } 80 66 81 67 /** 82 * bbp_init ()68 * Initialize any code after everything has been loaded 83 69 * 84 * Initialize any code after everything has been loaded 70 * @since bbPress (r2599) 71 * 72 * @uses do_action() Calls 'bbp_init' 85 73 */ 86 function bbp_init () {74 function bbp_init() { 87 75 do_action ( 'bbp_init' ); 88 76 } … … 91 79 92 80 /** 93 * bbp_setup_current_user ()94 *95 81 * Setup the currently logged-in user 96 82 * 97 83 * @since bbPress (r2695) 84 * 85 * @uses do_action() Calls 'bbp_setup_current_user' 98 86 */ 99 function bbp_setup_current_user () {87 function bbp_setup_current_user() { 100 88 do_action ( 'bbp_setup_current_user' ); 101 89 } 102 90 103 91 /** 104 * register_textdomain ()92 * Load translations for current language 105 93 * 106 * Load translations for current language 94 * @since bbPress (r2599) 95 * 96 * @uses do_action() Calls 'bbp_load_textdomain' 107 97 */ 108 function bbp_register_textdomain () {98 function bbp_register_textdomain() { 109 99 do_action( 'bbp_load_textdomain' ); 110 100 } 111 101 112 102 /** 113 * bbp_register_theme_directory ()114 *115 103 * Sets up the theme directory 116 104 * 117 105 * @since bbPress (r2507) 106 * 107 * @uses do_action() Calls 'bbp_register_theme_directory' 118 108 */ 119 function bbp_register_theme_directory () {109 function bbp_register_theme_directory() { 120 110 do_action( 'bbp_register_theme_directory' ); 121 111 } 122 112 123 113 /** 124 * bbp_register_post_types ()125 *126 114 * Setup the post types 127 115 * 128 116 * @since bbPress (r2464) 117 * 118 * @uses do_action() Calls 'bbp_register_post_type' 129 119 */ 130 function bbp_register_post_types () {120 function bbp_register_post_types() { 131 121 do_action ( 'bbp_register_post_types' ); 132 122 } 133 123 134 124 /** 135 * bbp_register_post_statuses ()136 *137 125 * Setup the post statuses 138 126 * 139 127 * @since bbPress (r2727) 128 * 129 * @uses do_action() Calls 'bbp_register_post_statuses' 140 130 */ 141 function bbp_register_post_statuses () {131 function bbp_register_post_statuses() { 142 132 do_action ( 'bbp_register_post_statuses' ); 143 133 } 144 134 145 135 /** 146 * bbp_register_taxonomies ()147 *148 136 * Register the built in bbPress taxonomies 149 137 * 150 138 * @since bbPress (r2464) 139 * 140 * @uses do_action() Calls 'bbp_register_taxonomies' 151 141 */ 152 function bbp_register_taxonomies () {142 function bbp_register_taxonomies() { 153 143 do_action ( 'bbp_register_taxonomies' ); 154 144 } 155 145 156 146 /** 157 * bbp_add_user_rewrite_tag ()147 * Add the bbPress-specific rewrite tags 158 148 * 159 * Add the %bbp_user% rewrite tag149 * @since bbPress (r2753) 160 150 * 161 * @ since bbPress (r2688)151 * @uses do_action() Calls 'bbp_add_rewrite_tags' 162 152 */ 163 function bbp_add_ user_rewrite_tag() {164 do_action ( 'bbp_add_ user_rewrite_tag' );153 function bbp_add_rewrite_tags() { 154 do_action ( 'bbp_add_rewrite_tags' ); 165 155 } 166 156 167 157 /** 168 * bbp_generate_rewrite_rules () 169 * 170 * Generate rewrite rules, particularly for /user/%bbp_user%/ pages 158 * Generate bbPress-specific rewrite rules 171 159 * 172 160 * @since bbPress (r2688) 173 161 * 174 * @param object $wp_rewrite 162 * @param WP_Rewrite $wp_rewrite 163 * 164 * @uses do_action() Calls 'bbp_generate_rewrite_rules' with {@link WP_Rewrite} 175 165 */ 176 function bbp_generate_rewrite_rules ( $wp_rewrite ) {166 function bbp_generate_rewrite_rules( $wp_rewrite ) { 177 167 do_action_ref_array( 'bbp_generate_rewrite_rules', array( &$wp_rewrite ) ); 178 168 } … … 181 171 182 172 /** 183 * bb p_ready ()173 * bbPress has loaded and initialized everything, and is okay to go 184 174 * 185 * bbPress has loaded and initialized everything, and is okay to go 175 * @since bbPress (r2618) 176 * 177 * @uses do_action() Calls 'bbp_ready' 186 178 */ 187 function bbp_ready () {179 function bbp_ready() { 188 180 do_action( 'bbp_ready' ); 189 181 }
Note: See TracChangeset
for help on using the changeset viewer.