/** * Register available settings */ public function register_settings() { $options = Shortest_Monetization::get_default_options(); foreach ($options as $key => $value) { register_setting('shst-settings-group', $key); } }
/** * Return an instance of this class. * * @since 1.0.0 * * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }
<div class="wrap shortest-admin"> <?php Shortest_Monetization::get_api_token(); $withAPI = get_option('shst_api_ready'); $token = get_option('shst_token'); ?> <h2 class="shortest-header-widget"><?php echo esc_html(get_admin_page_title()); ?> </h2> <div class="shortest-left"> <form method="post" action="options.php"> <?php settings_fields('shst-settings-group'); ?> <?php do_settings_sections('shst-settings-group'); ?> <div class="shortest-settings-group"> <h2 class="shortest-header">Base Options</h2> <div class="shortest-options-group"> <?php if ($withAPI) { ?> <label class="shortest-label" for="shst_token">Shorte.st email</label> <input type="text" class="shortest-input-text" id="shst_email" name="shst_email" value="<?php echo esc_html(get_option('shst_email')); ?> " />