addSettingSections(
$this->sPageSlug, // the target page slug
array(
'tab_slug' => $this->sTabSlug,
'section_id' => $this->sSectionID,
'title' => __( 'Capabilities', 'admin-page-framework-loader' ),
'description' => array(
__( 'By using the capability 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 edit_pages capability.', 'admin-page-framework-loader' ),
),
'capability' => 'edit_pages',
)
);
// Fields
$oFactory->addSettingFields(
$this->sSectionID, // the target section ID
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 manage_options 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 edit_pages capability.', 'admin-page-framework-loader' ),
// 'capability' => 'edit_pages', // this should be inherited from the section.
)
);
}
}