Skip to content

Commit c1b9685

Browse files
committed
Bail early if no URLs to ping.
1 parent e681496 commit c1b9685

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

inc/namespace.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ function ping_indexnow( $post ) {
300300
*/
301301
$url_list = apply_filters( 'pwcc/index-now/url-list', $url_list, $post );
302302

303+
if ( empty( $url_list ) ) {
304+
// If no URLs to ping, do nothing.
305+
return;
306+
}
307+
303308
if ( empty( get_option( 'permalink_structure' ) ) ) {
304309
$key_location = home_url( '?pwcc_indexnow_key=' . $key );
305310
} else {

0 commit comments

Comments
 (0)