| @@ -1,12 +1,14 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -defined( 'ABSPATH' ) or die; | |
| 3 | +defined('ABSPATH') or die; | |
| 4 | 4 | |
| 5 | 5 | add_action('admin_init', 'code_block_pro_register_settings'); |
| 6 | 6 | add_action('rest_api_init', 'code_block_pro_register_settings'); |
| 7 | 7 | if (!function_exists('code_block_pro_register_settings')) { |
| 8 | - function code_block_pro_register_settings() { | |
| 8 | + function code_block_pro_register_settings() | |
| 9 | + { | |
| 10 | + // This one should have been named "theme settings" or simliar | |
| 9 | 11 | register_setting('code_block_pro_settings', 'code_block_pro_settings', [ |
| 10 | 12 | 'type' => 'object', |
| 11 | 13 | 'show_in_rest' => [ |
| 12 | 14 | 'schema' => [ |
| @@ -17,8 +19,30 @@ | ||
| 17 | 19 | 'previousFontFamily' => [ 'type' => ['string', 'null']], |
| 18 | 20 | 'previousFontSize' => [ 'type' => ['string', 'null']], |
| 19 | 21 | 'previousLineHeight' => [ 'type' => ['string', 'null']], |
| 20 | 22 | 'previousHeaderType' => [ 'type' => ['string', 'null']], |
| 23 | + 'previousFooterType' => [ 'type' => ['string', 'null']], | |
| 24 | + 'previousClampFonts' => [ 'type' => ['boolean', 'null']], | |
| 25 | + 'previousDisablePadding' => [ 'type' => ['boolean', 'null']], | |
| 26 | + 'previousLineNumbers' => [ 'type' => ['boolean', 'null']], | |
| 27 | + ], | |
| 28 | + ], | |
| 29 | + ], | |
| 30 | + ]); | |
| 31 | + register_setting('code_block_pro_settings_2', 'code_block_pro_settings_2', [ | |
| 32 | + 'type' => 'object', | |
| 33 | + 'default' => [ | |
| 34 | + 'version' => 0, | |
| 35 | + 'seenNotices' => [], | |
| 36 | + 'hiddenThemes' => [], | |
| 37 | + ], | |
| 38 | + 'show_in_rest' => [ | |
| 39 | + 'schema' => [ | |
| 40 | + 'type' => 'object', | |
| 41 | + 'properties' => [ | |
| 42 | + "version" => [ 'type' => ['string', 'number'] ], | |
| 43 | + 'seenNotices' => [ 'type' => ['array', 'null']], | |
| 44 | + 'hiddenThemes' => [ 'type' => ['array', 'null']], | |
| 21 | 45 | ], |
| 22 | 46 | ], |
| 23 | 47 | ], |
| 24 | 48 | ]); |