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 @@ -449,7 +449,17 @@ function async_ping_indexnow( $post ) {
449449
450450 $ post_id = $ post ->ID ;
451451
452+ /**
453+ * Filter the delay (in seconds) before the asynchronous ping runs.
454+ *
455+ * @param int $delay The delay in seconds. Default is 10 seconds.
456+ */
457+ $ delay = apply_filters ( 'simple_search_submission_async_wait ' , 10 , $ post );
458+
459+ // Revert delay to default if it isn't numeric.
460+ $ delay = is_numeric ( $ delay ) ? (int ) $ delay : 10 ;
461+
452462 if ( ! wp_next_scheduled ( 'simple_search_submission_async_ping ' , array ( $ post_id ) ) ) {
453- wp_schedule_single_event ( time () + 5 , 'simple_search_submission_async_ping ' , array ( $ post_id ) );
463+ wp_schedule_single_event ( time () + $ delay , 'simple_search_submission_async_ping ' , array ( $ post_id ) );
454464 }
455465}
You can’t perform that action at this time.
0 commit comments