Skip to content

Commit bf65015

Browse files
committed
Notify async when requested.
1 parent a380575 commit bf65015

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

inc/namespace.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ function bootstrap() {
3838
*/
3939
$notify_async = apply_filters( 'pwcc/index-now/notify-async', false );
4040

41-
add_action( 'pwcc/index-now/ping', __NAMESPACE__ . '\\async_ping_indexnow', 10, 1 );
42-
// For sites doing synchronous pings this would use the hook above instead.
43-
add_action( 'pwcc/index-now/async_ping', __NAMESPACE__ . '\\ping_indexnow', 10, 1 );
41+
if ( $notify_async ) {
42+
// Use the async ping action.
43+
add_action( 'pwcc/index-now/ping', __NAMESPACE__ . '\\async_ping_indexnow', 10, 1 );
44+
add_action( 'pwcc/index-now/async_ping', __NAMESPACE__ . '\\ping_indexnow', 10, 1 );
45+
} else {
46+
// Use the synchronous ping action.
47+
add_action( 'pwcc/index-now/ping', __NAMESPACE__ . '\\ping_indexnow', 10, 1 );
48+
}
4449
}
4550

4651
/**

0 commit comments

Comments
 (0)