Sets up capabilities for the plugin DB object managers.
Description
See also
Source
File: src/torro-forms.php
protected function setup_capabilities() { // Map form and its component capabilities to post capabilities. $this->forms->capabilities()->map_capabilities( 'posts' ); $this->containers->capabilities()->map_capabilities( 'posts' ); $this->elements->capabilities()->map_capabilities( 'posts' ); $this->element_choices->capabilities()->map_capabilities( 'posts' ); $this->element_settings->capabilities()->map_capabilities( 'posts' ); $this->submissions->capabilities()->map_capabilities( 'posts' ); $this->submission_values->capabilities()->map_capabilities( 'posts' ); // Map form category capabilities to category capabilities. $this->form_categories->capabilities()->map_capabilities( 'categories' ); // Grant access to plugin settings if the user can manage options. $this->forms->capabilities()->grant_capabilities( array( 'manage_item_settings' => 'manage_options', ) ); }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |