public function __construct()
 {
     //Get list of groups
     self::$fields_groups = wpcf_admin_fields_get_groups();
     // setup custom capabilities
     //If access plugin installed
     if (function_exists('wpcf_access_register_caps')) {
         // integrate with Types Access
         if (!empty(self::$fields_groups)) {
             $access_version = apply_filters('toolset_access_version_installed', '1.0');
             // Since 2.1 we can define a custom tab on Access >= 2.1
             if (version_compare($access_version, '2.0') > 0) {
                 // Add Types Fields tab
                 add_filter('types-access-tab', array('Post_Fields_Access', 'register_access_types_fields_tab'));
                 //Add Usermeta Fields area
                 add_filter('types-access-area-for-types-fields', array('Post_Fields_Access', 'register_access_fields_area'), 10, 2);
             } else {
                 //Add Usermeta Fields area
                 add_filter('types-access-area', array('Post_Fields_Access', 'register_access_fields_area'), 10, 2);
             }
             //Add Fields groups
             add_filter('types-access-group', array('Post_Fields_Access', 'register_access_fields_groups'), 10, 2);
             //Add Fields caps to groups
             add_filter('types-access-cap', array('Post_Fields_Access', 'register_access_fields_caps'), 10, 3);
             //}
         }
     }
 }
Exemple #2
0
 public function __construct()
 {
     //Get list of groups
     self::$fields_groups = wpcf_admin_fields_get_groups();
     // setup custom capabilities
     //If access plugin installed
     if (function_exists('wpcf_access_register_caps')) {
         // integrate with Types Access
         if (!empty(self::$fields_groups)) {
             //Add Fields area
             add_filter('types-access-area', array('Post_Fields_Access', 'register_access_fields_area'), 10, 2);
             //Add Fields groups
             add_filter('types-access-group', array('Post_Fields_Access', 'register_access_fields_groups'), 10, 2);
             //Add Fields caps to groups
             add_filter('types-access-cap', array('Post_Fields_Access', 'register_access_fields_caps'), 10, 3);
             //}
         }
     }
 }