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

Problem with register_setting()

Your code looks fine at first glance, but the Plugin Checker is complaining about the dynamic argument in register_setting(). This usually happens when register_setting() receives an argument that is not a direct function reference or a string literal. function inseco_sanitize_textarea($input) { return wp_kses_post($input); } register_setting( ‘inseco_settings_group’, ‘inseco_code_after_page’, array( ‘type’ => ‘string’, ‘sanitize_callback’ => ‘inseco_sanitize_textarea’, // … Read more

Are woocommerce_thankyou hook and is_order_received_page() redundant? [closed]

The WooCommerce Code Reference for the woocommerce_thankyou hook points to WooCommerce thankyou page code: The thankyou page checks if the order failed or was successful, using the order-received.php, as you can see below (lines 23 to 51): <div class=”woocommerce-order”> <?php if ( $order ) : do_action( ‘woocommerce_before_thankyou’, $order->get_id() ); ?> <?php if ( $order->has_status( ‘failed’ … Read more

My wordpress plugin defaults to English (US) I would like it to default to English (UK)

Unfortunately, there does not appear to be a way to change the default language away from EN-US, in the wordpress.org repository. An email responce just recieved from plugins[at]wordpress.org has confirmed that the default of EN-US is an intentional policy process. The submission is done in English US and then you will be able to translate … Read more