381 | | $capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name ); |
| 376 | /** |
| 377 | * Filter which capabilities a role has. |
| 378 | * |
| 379 | * @since 2.0.1 |
| 380 | * |
| 381 | * @param array $this->capabilities Array of role capabilities. |
| 382 | * @param string $cap Capability name. |
| 383 | * @param string $this->name Role name. |
| 384 | */ |
| 385 | $capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name ); |
825 | | do_action( 'set_user_role', $this->ID, $role, $old_roles ); |
| 829 | |
| 830 | /** |
| 831 | * Perform an action after the user's role has changed. |
| 832 | * |
| 833 | * @since 2.9.1 |
| 834 | * @since 3.6.1 Added $old_roles |
| 835 | * |
| 836 | * @param int $this->ID The user ID. |
| 837 | * @param string $role The new role. |
| 838 | * @param array $old_roles An array of user's previous roles. |
| 839 | */ |
| 840 | do_action( 'set_user_role', $this->ID, $role, $old_roles ); |
945 | | // Must have ALL requested caps |
946 | | $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this ); |
| 960 | /** |
| 961 | * Dynamically filter a user's capabilities. |
| 962 | * |
| 963 | * @since 2.0.1 |
| 964 | * @since 3.7.0 Added $this |
| 965 | * |
| 966 | * @param array $this->allcaps An array of all the role's |
| 967 | * capabilities. |
| 968 | * @param array $caps Actual capabilities for meta |
| 969 | * capability. |
| 970 | * @param array $args Optional parameters passed to |
| 971 | * has_cap(). Typically object ID. |
| 972 | * @param WP_User $this The user object. |
| 973 | */ |
| 974 | // Must have ALL requested caps |
| 975 | $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this ); |
1173 | | $allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps ); |
| 1202 | /** |
| 1203 | * Filter controls if the user is allowed to add post meta to a |
| 1204 | * post. |
| 1205 | * |
| 1206 | * `$meta_key` is the meta key passed to map_meta_cap(). |
| 1207 | * |
| 1208 | * @since 3.3.1 |
| 1209 | * |
| 1210 | * @param bool false Whether the user can add the |
| 1211 | * post meta or not. Defaults to false. |
| 1212 | * @param string $mete_key The meta key. |
| 1213 | * @param int $post->ID Post ID. |
| 1214 | * @param int $user_id User ID. |
| 1215 | * @param string $cap Capability name. |
| 1216 | * @param array $caps User capabilities. |
| 1217 | */ |
| 1218 | $allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps ); |
1274 | | return apply_filters('map_meta_cap', $caps, $cap, $user_id, $args); |
| 1319 | /** |
| 1320 | * Filter a user's capabilities depending on specific |
| 1321 | * a context and/or privilege. |
| 1322 | * |
| 1323 | * @since 2.8.1 |
| 1324 | * |
| 1325 | * @param array $caps Returns user's actual capabilities. |
| 1326 | * @param string $cap Capability name |
| 1327 | * @param int $user_id The user ID. |
| 1328 | * @param array $args Adds the context to the cap. |
| 1329 | * Typically the object ID. |
| 1330 | */ |
| 1331 | return apply_filters('map_meta_cap', $caps, $cap, $user_id, $args); |