Changeset 6106
- Timestamp:
- 11/01/2016 05:14:29 AM (9 years ago)
- Location:
- trunk/src/includes/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/abstraction.php
r6057 r6106 8 8 * 9 9 * Many of the functions in this file are considered superfluous by 10 * WordPress coding standards, but 10 * WordPress coding standards, but they're handy for plugins of plugins to use. 11 11 * 12 12 * @package bbPress … … 49 49 // Filter & return 50 50 return apply_filters( 'bbp_get_global_object', $retval, $name, $type, $default ); 51 } 52 53 /** 54 * Get the `$wp_roles` global without needing to declare it everywhere 55 * 56 * @since 2.2.0 bbPress (r4293) 57 * 58 * @return WP_Roles 59 */ 60 function bbp_get_wp_roles() { 61 return bbp_get_global_object( 'wp_roles', 'WP_Roles' ); 51 62 } 52 63 -
trunk/src/includes/core/actions.php
r6058 r6106 42 42 add_action( 'parse_query', 'bbp_parse_query', 2 ); // Early for overrides 43 43 add_action( 'widgets_init', 'bbp_widgets_init', 10 ); 44 add_action( 'wp_roles_init', 'bbp_roles_init', 10 ); 44 45 add_action( 'generate_rewrite_rules', 'bbp_generate_rewrite_rules', 10 ); 45 46 add_action( 'wp_enqueue_scripts', 'bbp_enqueue_scripts', 10 ); … … 68 69 add_action( 'bbp_loaded', 'bbp_setup_user_option_filters', 12 ); 69 70 add_action( 'bbp_loaded', 'bbp_register_theme_packages', 14 ); 70 add_action( 'bbp_loaded', 'bbp_filter_user_roles_option', 16 );71 71 72 72 /** … … 85 85 86 86 /** 87 * There is no action API for roles to use, so hook in immediately after 88 * everything is included (including the theme's functions.php. This is after 89 * the $wp_roles global is set but before $wp->init(). 90 * 91 * If it's hooked in any sooner, role names may not be translated correctly. 92 * 93 * @link https://bbpress.trac.wordpress.org/ticket/2219 94 * 95 * This is kind of lame, but is all we have for now. 96 */ 97 add_action( 'bbp_after_setup_theme', 'bbp_add_forums_roles', 1 ); 87 * bbp_roles_init - Attached to 'wp_roles_init' above 88 * 89 * Attach various role related actions to the wp_roles_init action. 90 * The load order helps to execute code at the correct time. 91 * v---Load order 92 */ 93 add_action( 'bbp_roles_init', 'bbp_add_forums_roles', 1 ); 98 94 99 95 /** -
trunk/src/includes/core/sub-actions.php
r6105 r6106 134 134 function bbp_init() { 135 135 do_action( 'bbp_init' ); 136 } 137 138 /** 139 * Initialize roles 140 * 141 * @since 2.6.0 bbPress (r6106) 142 * 143 * @uses do_action() Calls 'bbp_roles_init' 144 * 145 * @param WP_Roles $wp_roles The array of WP_Role objects that was initialized 146 */ 147 function bbp_roles_init( $wp_roles ) { 148 do_action( 'bbp_roles_init', $wp_roles ); 136 149 } 137 150
Note: See TracChangeset
for help on using the changeset viewer.