Creating a heading option with a description: *
$adminPage->createOption( array(
 *     'name' => __( 'Enable Feature', 'default' ),
 *     'type' => 'enable',
 *     'default' => true,
 *     'desc' => __( 'You can disable this feature if you do not like it', 'default' ),
 * ) );
* * @since 1.0 * @type enable * @availability Admin Pages|Meta Boxes|Customizer */ class MobileMenuOptionEnable extends MobileMenuOption { private static $firstLoad = true; /** * Default settings specific for this option * @var array */ public $defaultSecondarySettings = array( /** * (Optional) The label to display in the enable portion of the buttons * * @since 1.0 * @var string */ 'enabled' => '', /** * (Optional) The label to display in the disable portion of the buttons * * @since 1.0 * @var string */ 'disabled' => '', ); /* * Display for options and meta */ public function display() { $this->echoOptionHeader(); if ( empty( $this->settings['enabled'] ) ) { $this->settings['enabled'] = __( 'Enabled', 'mobile-menu' ); } if ( empty( $this->settings['disabled'] ) ) { $this->settings['disabled'] = __( 'Disabled', 'mobile-menu' ); } ?> getValue(), 1 ) ?>> settings['enabled'] ?>settings['disabled'] ?> echoOptionFooter(); self::$firstLoad = false; } public function cleanValueForSaving( $value ) { return $value != '1' ? '0' : '1'; } public function cleanValueForGetting( $value ) { if ( is_bool( $value ) ) { return $value; } return $value == '1' ? true : false; } }