@@ -40,6 +40,9 @@ public static function init() {
40
40
// Support Webmention delete
41
41
add_action ( 'webmention_data_error ' , array ( static ::class, 'delete ' ) );
42
42
43
+ // Add scheduler for async processing
44
+ add_action ( 'webmention_process_schedule ' , array ( static ::class, 'process ' ) );
45
+
43
46
self ::register_meta ();
44
47
}
45
48
@@ -215,10 +218,6 @@ public static function get( $request ) {
215
218
* @param WP_REST_Request $request Full data about the request.
216
219
*
217
220
* @return WP_Error|WP_REST_Response
218
- *
219
- * @uses apply_filters calls "webmention_comment_data" on the comment data
220
- * @uses apply_filters calls "webmention_update" on the comment data
221
- * @uses apply_filters calls "webmention_success_message" on the success message
222
221
*/
223
222
public static function post ( $ request ) {
224
223
$ source = $ request ->get_param ( 'source ' );
@@ -317,6 +316,17 @@ public static function post( $request ) {
317
316
return new WP_REST_Response ( $ return , 202 );
318
317
}
319
318
319
+ return self ::process ( $ commentdata );
320
+ }
321
+
322
+ /**
323
+ * Process the Webmention.
324
+ *
325
+ * @param array $commentdata The comment data.
326
+ *
327
+ * @return WP_REST_Response|WP_Error The response or an error.
328
+ */
329
+ public static function process ( $ commentdata ) {
320
330
/**
321
331
* Filter Comment Data for Webmentions.
322
332
*
0 commit comments