Settings implements Standard_Service, Registerable, Conditional
This class handles our plugin settings page in the admin.
Tags
Interfaces, Classes and Traits
- Standard_Service
- Registerable
- Conditional
Table of Contents
- MENU_SLUG = 'document_library_pro'
- $plugin : mixed
- __construct() : mixed
- Constructor.
- add_settings_page() : mixed
- Register the Settings submenu page.
- filter_settings_capability() : string
- Bridge our own settings-page capability filter into the bundled settings-api capability filter. The menu page uses document_library_pro_settings_page_capability; the settings-api applies its own barn2_settings_api_{slug}_capability filter to the REST permission and option read/write helpers. Wiring ours into theirs keeps the menu page and the REST layer in sync, so a host only needs to hook the one plugin-owned filter.
- is_required() : mixed
- {@inheritdoc}
- register() : mixed
- {@inheritdoc}
- render_settings_page() : mixed
- Render the Settings page.
Constants
MENU_SLUG
public
mixed
MENU_SLUG
= 'document_library_pro'
Tags
Properties
$plugin
private
mixed
$plugin
Tags
Methods
__construct()
Constructor.
public
__construct(Licensed_Plugin $plugin) : mixed
Parameters
- $plugin : Licensed_Plugin
Tags
Return values
mixed —add_settings_page()
Register the Settings submenu page.
public
add_settings_page() : mixed
Tags
Return values
mixed —filter_settings_capability()
Bridge our own settings-page capability filter into the bundled settings-api capability filter. The menu page uses document_library_pro_settings_page_capability; the settings-api applies its own barn2_settings_api_{slug}_capability filter to the REST permission and option read/write helpers. Wiring ours into theirs keeps the menu page and the REST layer in sync, so a host only needs to hook the one plugin-owned filter.
public
filter_settings_capability(string $capability) : string
Parameters
- $capability : string
-
The capability resolved by the settings-api. Default 'manage_options'.
Tags
Return values
string —is_required()
{@inheritdoc}
public
is_required() : mixed
Tags
Return values
mixed —register()
{@inheritdoc}
public
register() : mixed
Tags
Return values
mixed —render_settings_page()
Render the Settings page.
public
render_settings_page() : mixed