block-editor
1 year ago
config-validator
11 months ago
css
2 weeks ago
js
1 year ago
swv
9 months ago
capabilities.php
7 years ago
contact-form-functions.php
11 months ago
contact-form-template.php
11 months ago
contact-form.php
11 months ago
controller.php
11 months ago
file.php
9 months ago
filesystem.php
11 months ago
form-tag.php
7 months ago
form-tags-manager.php
11 months ago
formatting.php
11 months ago
functions.php
9 months ago
html-formatter.php
9 months ago
integration.php
11 months ago
l10n.php
11 months ago
mail-tag.php
11 months ago
mail.php
3 months ago
pipe.php
11 months ago
pocket-holder.php
3 years ago
rest-api.php
11 months ago
shortcodes.php
11 months ago
special-mail-tags.php
9 months ago
submission.php
9 months ago
upgrade.php
11 months ago
validation-functions.php
11 months ago
validation.php
11 months ago
capabilities.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | add_filter( 'map_meta_cap', 'wpcf7_map_meta_cap', 10, 4 ); |
| 4 | |
| 5 | function wpcf7_map_meta_cap( $caps, $cap, $user_id, $args ) { |
| 6 | $meta_caps = array( |
| 7 | 'wpcf7_edit_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, |
| 8 | 'wpcf7_edit_contact_forms' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, |
| 9 | 'wpcf7_read_contact_form' => WPCF7_ADMIN_READ_CAPABILITY, |
| 10 | 'wpcf7_read_contact_forms' => WPCF7_ADMIN_READ_CAPABILITY, |
| 11 | 'wpcf7_delete_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, |
| 12 | 'wpcf7_delete_contact_forms' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, |
| 13 | 'wpcf7_manage_integration' => 'manage_options', |
| 14 | 'wpcf7_submit' => 'read', |
| 15 | ); |
| 16 | |
| 17 | $meta_caps = apply_filters( 'wpcf7_map_meta_cap', $meta_caps ); |
| 18 | |
| 19 | $caps = array_diff( $caps, array_keys( $meta_caps ) ); |
| 20 | |
| 21 | if ( isset( $meta_caps[$cap] ) ) { |
| 22 | $caps[] = $meta_caps[$cap]; |
| 23 | } |
| 24 | |
| 25 | return $caps; |
| 26 | } |
| 27 |