PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
← All changes | classes/RestAPI/BlockTypes.php +1 -3 trunk2.6.1 View file →
@@ -47,9 +47,9 @@
47 47 [
48 48 [
49 49 'methods' => WP_REST_Server::READABLE,
50 50 'callback' => [ $this, 'get_block_types' ],
51 - 'permission_callback' => [ $this, 'update_block_types_permissions' ],
51 + 'permission_callback' => '__return_true', // Read only, so anyone can view.
52 52 ],
53 53 [
54 54 'methods' => WP_REST_Server::EDITABLE,
55 55 'callback' => [ $this, 'update_block_types' ],
@@ -94,10 +94,8 @@
94 94 $block_types = $request->get_json_params();
95 95
96 96 $error_message = __( 'Something went wrong, the block types could not be updated.', 'content-control' );
97 97
98 - // Following line is sanity check to ensure get_block_types() returns an array to prevent runtime errors.
99 - // @phpstan-ignore-next-line .
100 98 if ( ! is_array( get_block_types() ) ) {
101 99 return new WP_Error( '500', $error_message, [ 'status' => 500 ] );
102 100 }
103 101