| @@ -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 | |