wpcf7_map_meta_cap
The Contact Form 7 wpcf7 map meta cap function.
Description
Parameters (4)
- 0. $caps
- The caps.
- 1. $cap
- The cap.
- 2. $user_id
- The user id.
- 3. $args
- The args.
Usage
if ( !function_exists( 'wpcf7_map_meta_cap' ) ) { require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/capabilities.php'; } // The caps. $caps = null; // The cap. $cap = null; // The user id. $user_id = null; // The args. $args = null; // NOTICE! Understand what this does before running. $result = wpcf7_map_meta_cap($caps, $cap, $user_id, $args);
Defined (1)
The function is defined in the following location(s).
- /includes/capabilities.php
- function wpcf7_map_meta_cap( $caps, $cap, $user_id, $args ) {
- $meta_caps = array(
- 'wpcf7_edit_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY,
- 'wpcf7_edit_contact_forms' => WPCF7_ADMIN_READ_WRITE_CAPABILITY,
- 'wpcf7_read_contact_forms' => WPCF7_ADMIN_READ_CAPABILITY,
- 'wpcf7_delete_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY,
- 'wpcf7_manage_integration' => 'manage_options',
- );
- $meta_caps = apply_filters( 'wpcf7_map_meta_cap', $meta_caps );
- $caps = array_diff( $caps, array_keys( $meta_caps ) );
- if ( isset( $meta_caps[$cap] ) ) {
- $caps[] = $meta_caps[$cap];
- }
- return $caps;
- }