Implement a webhook endpoint into a plugin

you can create a new API route like that : add_action(“rest_api_init”, function () { register_rest_route( “test_api” , “reading_http_json” , [ “methods” => WP_REST_Server::EDITABLE, // POST PUT PATCH “callback” => function (WP_REST_Request $request) { $body = file_get_contents(“php://input”); $json = json_decode($body, TRUE); // here you have data in the array $json return NULL; }, “permission_callback” => fn … Read more

Custom Gutenberg blocks not showing in WP editor

The import syntax only works if you are using a build system (the npm/npx stuff). If you don’t want to use that right now, you can replace the import with wp.<module> like: const { registerBlockType } = wp.blocks; registerBlockType(‘custom-blocks/simple-block’, { edit: () => ‘abc’, save: () => ‘abc’ }); Or directly like: wp.blocks.registerBlockType(‘custom-blocks/simple-block’, { edit: … Read more

error code: 521