APF_Demo_AdvancedUsage_Argument_Capability::__construct PHP Method

__construct() public method

Sets up a form section.
public __construct ( $oFactory )
    public function __construct($oFactory)
    {
        // Section
        $oFactory->addSettingSections($this->sPageSlug, array('tab_slug' => $this->sTabSlug, 'section_id' => $this->sSectionID, 'title' => __('Capabilities', 'admin-page-framework-loader'), 'description' => array(__('By using the <code>capability</code> argument, you can control whether a field/section should be displayed to the user.', 'admin-page-framework-loader'), __('This section is only shown to the users with the <code>edit_pages</code> capability.', 'admin-page-framework-loader')), 'capability' => 'edit_pages'));
        // Fields
        $oFactory->addSettingFields($this->sSectionID, array('field_id' => 'for_site_admin', 'title' => __('Site Admin Only', 'admin-page-framework-loader'), 'type' => 'text', 'description' => __('This field is only shown to the users with the <code>manage_options</code> capability.', 'admin-page-framework-loader'), 'capability' => 'manage_options'), array('field_id' => 'for_editors', 'title' => __('Editors or Higher Users Only', 'admin-page-framework-loader'), 'type' => 'text', 'description' => __('This field is only shown to the users with the <code>edit_pages</code> capability.', 'admin-page-framework-loader')));
    }
APF_Demo_AdvancedUsage_Argument_Capability