| 1 |
<?php |
| 2 |
|
| 3 |
defined('ABSPATH') or die; |
| 4 |
|
| 5 |
add_action('admin_init', 'code_block_pro_register_settings'); |
| 6 |
add_action('rest_api_init', 'code_block_pro_register_settings'); |
| 7 |
if (!function_exists('code_block_pro_register_settings')) { |
| 8 |
function code_block_pro_register_settings() |
| 9 |
{ |
| 10 |
// This one should have been named "theme settings" or simliar |
| 11 |
register_setting('code_block_pro_settings', 'code_block_pro_settings', [ |
| 12 |
'type' => 'object', |
| 13 |
'show_in_rest' => [ |
| 14 |
'schema' => [ |
| 15 |
'type' => 'object', |
| 16 |
'properties' => [ |
| 17 |
"version" => [ 'type' => ['string', 'number'] ], |
| 18 |
'previousTheme' => [ 'type' => ['string', 'null']], |
| 19 |
'previousFontFamily' => [ 'type' => ['string', 'null']], |
| 20 |
'previousFontSize' => [ 'type' => ['string', 'null']], |
| 21 |
'previousLineHeight' => [ 'type' => ['string', 'null']], |
| 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']], |
| 45 |
], |
| 46 |
], |
| 47 |
], |
| 48 |
]); |
| 49 |
} |
| 50 |
} |
| 51 |
|