Lines Matching +refs:term +refs:cap
39 * @param string $cap Capability being checked.
44 function map_meta_cap( $cap, $user_id, ...$args ) { argument
47 switch ( $cap ) {
63 if ( 'edit_user' === $cap && isset( $args[0] ) && $user_id == $args[0] ) {
68 …if ( is_multisite() && ( ( ! is_super_admin( $user_id ) && 'edit_user' === $cap && is_super_admin(…
95 …o check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
101 $caps[] = $post_type->cap->$cap;
103 if ( 'delete_post' === $cap ) {
104 $cap = $post_type->cap->$cap;
113 $caps[] = $post_type->cap->delete_published_posts;
117 $caps[] = $post_type->cap->delete_published_posts;
119 $caps[] = $post_type->cap->delete_posts;
123 $caps[] = $post_type->cap->delete_posts;
127 $caps[] = $post_type->cap->delete_others_posts;
130 $caps[] = $post_type->cap->delete_published_posts;
132 $caps[] = $post_type->cap->delete_private_posts;
166 …o check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
172 $caps[] = $post_type->cap->$cap;
174 if ( 'edit_post' === $cap ) {
175 $cap = $post_type->cap->$cap;
184 $caps[] = $post_type->cap->edit_published_posts;
188 $caps[] = $post_type->cap->edit_published_posts;
190 $caps[] = $post_type->cap->edit_posts;
194 $caps[] = $post_type->cap->edit_posts;
198 $caps[] = $post_type->cap->edit_others_posts;
201 $caps[] = $post_type->cap->edit_published_posts;
203 $caps[] = $post_type->cap->edit_private_posts;
235 …o check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
241 $caps[] = $post_type->cap->$cap;
243 if ( 'read_post' === $cap ) {
244 $cap = $post_type->cap->$cap;
252 …capability "%2$s" against a post with that status.' ), get_post_status( $post ), $cap ), '5.4.0' );
258 $caps[] = $post_type->cap->read;
263 $caps[] = $post_type->cap->read;
265 $caps[] = $post_type->cap->read_private_posts;
280 …o check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' );
285 $caps[] = $post_type->cap->publish_posts;
299 $object_type = explode( '_', $cap )[1];
331 * @param string $cap Capability name.
334 …_meta_{$meta_key}_for_{$object_subtype}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
352 * @param string $cap Capability name.
355 …( "auth_{$object_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
378 * @param string $cap Capability name.
383 array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ),
390 $caps[] = $cap;
415 $caps[] = $cap;
442 $caps[] = $cap;
460 } elseif ( 'upload_themes' === $cap ) {
462 } elseif ( 'upload_plugins' === $cap ) {
465 $caps[] = $cap;
508 $caps[] = $cap;
510 $caps[] = $cap;
517 $caps[] = $cap;
536 $term = get_term( $term_id );
537 if ( ! $term || is_wp_error( $term ) ) {
542 $tax = get_taxonomy( $term->taxonomy );
548 if ( 'delete_term' === $cap
549 && ( get_option( 'default_' . $term->taxonomy ) == $term->term_id
550 || get_option( 'default_term_' . $term->taxonomy ) == $term->term_id )
556 $taxo_cap = $cap . 's';
558 $caps = map_meta_cap( $tax->cap->$taxo_cap, $user_id, $term_id );
581 $caps[] = $cap;
621 if ( isset( $post_type_meta_caps[ $cap ] ) ) {
622 return map_meta_cap( $post_type_meta_caps[ $cap ], $user_id, ...$args );
638 if ( in_array( $cap, $block_caps, true ) ) {
639 $cap = str_replace( '_blocks', '_posts', $cap );
643 $caps[] = $cap;
653 * @param string $cap Capability being checked.
658 return apply_filters( 'map_meta_cap', $caps, $cap, $user_id, $args );