# b-blocks/2.1.8/includes/RegisterSettings.php

bBlocks – Essential Gutenberg Blocks &amp; Patterns Collection, version 2.1.8. 32 lines.

- Page: https://pluginprobe.com/plugins/b-blocks/2.1.8/code/includes/RegisterSettings.php
- Raw: https://pluginprobe.com/plugins/b-blocks/2.1.8/raw/includes/RegisterSettings.php
- Modified: 2026-09-27T04:52: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/b-blocks/2.1.8/code/includes/RegisterSettings.php#L10-L20`.

```php
<?php

namespace BBlocks\Inc;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class RegisterSettings
{
	function __construct()
	{
		add_action( 'admin_init', [$this, 'registerSettings'] );
		add_action( 'rest_api_init', [$this, 'registerSettings'] );
	}

	function registerSettings()
	{
		register_setting('bBlocksUtils', 'bBlocksUtils', [
			'show_in_rest' => [
				'name' => 'bBlocksUtils',
				'schema' => ['type' => 'string']
			],
			'type' => 'string',
			'default' => wp_json_encode(['nonce' => wp_create_nonce('wp_ajax')]),
			'sanitize_callback' => 'sanitize_text_field'
		]);
	}
}

new RegisterSettings();

```
