Changeset 9640
- Timestamp:
- 03/24/2015 06:07:07 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-caps.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-caps.php
r9351 r9640 31 31 : array(); 32 32 33 // Apply WordPress core filter to editable roles 33 /** 34 * Filters the list of editable roles. 35 * 36 * @since BuddyPress (2.1.0) 37 * 38 * @param array $roles List of roles. 39 */ 34 40 $roles = apply_filters( 'editable_roles', $roles ); 35 41 36 // Return the editable roles 42 /** 43 * Filters the array of roles from the currently loaded blog. 44 * 45 * @since BuddyPress (2.1.0) 46 * 47 * @param array $roles Available roles. 48 * @param WP_Roles $wp_roles Object of WordPress roles. 49 */ 37 50 return apply_filters( 'bp_get_current_blog_roles', $roles, $wp_roles ); 38 51 } … … 63 76 } 64 77 78 /** 79 * Fires after the addition of capabilities to WordPress user roles. 80 * 81 * This is called on plugin activation. 82 * 83 * @since BuddyPress (1.6.0) 84 */ 65 85 do_action( 'bp_add_caps' ); 66 86 } … … 91 111 } 92 112 113 /** 114 * Fires after the removal of capabilities from WordPress user roles. 115 * 116 * This is called on plugin deactivation. 117 * 118 * @since BuddyPress (1.6.0) 119 */ 93 120 do_action( 'bp_remove_caps' ); 94 121 } … … 111 138 */ 112 139 function bp_map_meta_caps( $caps, $cap, $user_id, $args ) { 140 141 /** 142 * Filters the community caps mapping to be built in WordPress caps. 143 * 144 * @since BuddyPress (1.6.0) 145 * 146 * @param array $caps Returns the user's actual capabilities. 147 * @param string $cap Capability name. 148 * @param int $user_id The user ID. 149 * @param array $args Adds the context to the cap. Typically the object ID. 150 */ 113 151 return apply_filters( 'bp_map_meta_caps', $caps, $cap, $user_id, $args ); 114 152 } … … 128 166 $caps = array(); 129 167 168 /** 169 * Filters community capabilities. 170 * 171 * @since BuddyPress (1.6.0) 172 * 173 * @param array $caps Array of capabilities to add. Empty by default. 174 */ 130 175 return apply_filters( 'bp_get_community_caps', $caps ); 131 176 } … … 164 209 } 165 210 211 /** 212 * Filters the array of capabilities based on the role that is being requested. 213 * 214 * @since BuddyPress (1.6.0) 215 * 216 * @param array $caps Array of capabilities to return. 217 * @param string $role The role currently being loaded. 218 */ 166 219 return apply_filters( 'bp_get_caps_for_role', $caps, $role ); 167 220 } … … 221 274 $retval = current_user_can_for_blog( $blog_id, $capability ); 222 275 276 /** 277 * Filters whether or not the current user has a given capability. 278 * 279 * @since BuddyPress (1.6.0) 280 * 281 * @param bool $retval Whether or not the current user has the capability. 282 * @param string $capability The capability being checked for. 283 * @param int $blog_id Blog ID. Defaults to the BP root blog. 284 */ 223 285 return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id ); 224 286 }
Note: See TracChangeset
for help on using the changeset viewer.