# code-block-pro/1.13.0/php/settings.php

Code Block Pro – Beautiful Syntax Highlighting, version 1.13.0. 51 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.13.0/code/php/settings.php
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.13.0/raw/php/settings.php
- Modified: 2023-01-04T04:16:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.13.0/code/php/settings.php#L10-L20`.

```php
<?php

defined('ABSPATH') or die;

add_action('admin_init', 'code_block_pro_register_settings');
add_action('rest_api_init', 'code_block_pro_register_settings');
if (!function_exists('code_block_pro_register_settings')) {
    function code_block_pro_register_settings()
    {
        // This one should have been named "theme settings" or simliar
        register_setting('code_block_pro_settings', 'code_block_pro_settings', [
            'type' => 'object',
            'show_in_rest' => [
                'schema' => [
                    'type' => 'object',
                    'properties' => [
                        "version" => [ 'type' => ['string', 'number'] ],
                        'previousTheme' => [ 'type' => ['string', 'null']],
                        'previousFontFamily' => [ 'type' => ['string', 'null']],
                        'previousFontSize' => [ 'type' => ['string', 'null']],
                        'previousLineHeight' => [ 'type' => ['string', 'null']],
                        'previousHeaderType' => [ 'type' => ['string', 'null']],
                        'previousFooterType' => [ 'type' => ['string', 'null']],
                        'previousClampFonts' => [ 'type' => ['boolean', 'null']],
                        'previousDisablePadding' => [ 'type' => ['boolean', 'null']],
                        'previousLineNumbers' => [ 'type' => ['boolean', 'null']],
                    ],
                ],
            ],
        ]);
        register_setting('code_block_pro_settings_2', 'code_block_pro_settings_2', [
            'type' => 'object',
            'default' => [
                'version' => 0,
                'seenNotices' => [],
                'hiddenThemes' => [],
            ],
            'show_in_rest' => [
                'schema' => [
                    'type' => 'object',
                    'properties' => [
                        "version" => [ 'type' => ['string', 'number'] ],
                        'seenNotices' => [ 'type' => ['array', 'null']],
                        'hiddenThemes' => [ 'type' => ['array', 'null']],
                    ],
                ],
            ],
        ]);
    }
}

```
