Changeset 2098726
- Timestamp:
- 05/31/2019 03:53:09 PM (7 years ago)
- Location:
- be-lazy/trunk/app
- Files:
-
- 3 edited
-
Helpers/Config.php (modified) (1 diff)
-
Helpers/Form.php (modified) (2 diffs)
-
Views/options_page.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
be-lazy/trunk/app/Helpers/Config.php
r2098711 r2098726 13 13 { 14 14 // Active status 15 register_setting(BE_LAZY_SLUG, self::get_name('active'), [ 16 'default' => '1' 17 ]); 15 register_setting(BE_LAZY_SLUG, self::get_name('active')); 18 16 } 19 17 -
be-lazy/trunk/app/Helpers/Form.php
r2098711 r2098726 7 7 class Form 8 8 { 9 public static function radio($base, $key, $value, $ label)9 public static function radio($base, $key, $value, $default, $label) 10 10 { 11 11 $name = Config::get_name($base . "[$key]"); … … 13 13 ob_start(); 14 14 15 checked(Config::get($base)[$key], $value); 15 $dbvalue = Config::get($base); 16 17 if(isset($dbvalue[$key])) 18 { 19 checked(Config::get($base)[$key], $value); 20 } 21 else 22 { 23 checked($default, $value); 24 } 16 25 17 26 $checked = ob_get_clean(); -
be-lazy/trunk/app/Views/options_page.php
r2098715 r2098726 1 1 <?php 2 2 3 use BeLazy\Helpers\Config; 3 4 use BeLazy\Helpers\Form; 5 4 6 ?> 5 7 … … 17 19 <td> 18 20 <fieldset> 19 <?php Form::radio('active', $post_type->name, '', __('Inactive', 'be-lazy')); ?>20 <?php Form::radio('active', $post_type->name, '1', __('Automatically', 'be-lazy')); ?>21 <?php Form::radio('active', $post_type->name, '2', __('Manually', 'be-lazy')); ?>21 <?php Form::radio('active', $post_type->name, '', '1', __('Inactive', 'be-lazy')); ?> 22 <?php Form::radio('active', $post_type->name, '1', '1', __('Automatically', 'be-lazy')); ?> 23 <?php Form::radio('active', $post_type->name, '2', '1', __('Manually', 'be-lazy')); ?> 22 24 </fieldset> 23 25 </td>
Note: See TracChangeset
for help on using the changeset viewer.