PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.26.8
Code Block Pro – Beautiful Syntax Highlighting v1.26.8
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / php / routes.php

routes.php in Code Block Pro – Beautiful Syntax Highlighting 1.26.8, at php/routes.php

34 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('ABSPATH') or die;
4
5 add_action('rest_api_init', function () {
6 CBPRouter::post('/settings', function ($payload) {
7 if (isset($payload['code_block_pro_settings'])) {
8 update_option('code_block_pro_settings', $payload['code_block_pro_settings']);
9 }
10 if (isset($payload['code_block_pro_settings_2'])) {
11 update_option('code_block_pro_settings_2', $payload['code_block_pro_settings_2']);
12 }
13 return new WP_REST_Response(
14 [
15 'code_block_pro_settings' => get_option('code_block_pro_settings'),
16 'code_block_pro_settings_2' => get_option('code_block_pro_settings_2'),
17 ]
18 );
19 });
20
21 CBPRouter::get('/settings', function () {
22 return new WP_REST_Response(
23 [
24 'code_block_pro_settings' => get_option('code_block_pro_settings'),
25 'code_block_pro_settings_2' => get_option('code_block_pro_settings_2'),
26 ]
27 );
28 });
29
30 CBPRouter::get('/can-save-html', function () {
31 return new WP_REST_Response(current_user_can('unfiltered_html'));
32 });
33 });
34