File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -424,7 +424,17 @@ function async_ping_indexnow( $post ) {
424424
425425 $ post_id = $ post ->ID ;
426426
427+ /**
428+ * Filter the delay (in seconds) before the asynchronous ping runs.
429+ *
430+ * @param int $delay The delay in seconds. Default is 10 seconds.
431+ */
432+ $ delay = apply_filters ( 'simple_search_submission_async_wait ' , 10 , $ post );
433+
434+ // Revert delay to default if it isn't numeric.
435+ $ delay = is_numeric ( $ delay ) ? (int ) $ delay : 10 ;
436+
427437 if ( ! wp_next_scheduled ( 'simple_search_submission_async_ping ' , array ( $ post_id ) ) ) {
428- wp_schedule_single_event ( time () + 5 , 'simple_search_submission_async_ping ' , array ( $ post_id ) );
438+ wp_schedule_single_event ( time () + $ delay , 'simple_search_submission_async_ping ' , array ( $ post_id ) );
429439 }
430440}
You can’t perform that action at this time.
0 commit comments