Skip to content

Commit 89f92c3

Browse files
committed
Allow for plain permalink structure.
1 parent be05bf7 commit 89f92c3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

inc/namespace.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,20 @@ function ping_indexnow( $post ) {
231231
*/
232232
$url_list = apply_filters( 'pwcc/index-now/url-list', array( $url ) );
233233

234+
if ( empty( get_option( 'permalink_structure' ) ) ) {
235+
$key_location = home_url( '?pwcc_indexnow_key=' . $key );
236+
} else {
237+
$key_location = trailingslashit( home_url( 'pwcc-indexnow-' . $key ) );
238+
}
239+
234240
/**
235241
* Filters the location of the IndexNow key file.
236242
*
237243
* @param string $key_location The URL where the key file is located.
238244
* @param array $url_list The list if URLs to be submitted.
239245
* @param WP_Post $post The post object.
240246
*/
241-
$key_location = apply_filters( 'pwcc/index-now/key-location', trailingslashit( home_url( 'pwcc-indexnow-' . $key ) ), $url_list, $post );
247+
$key_location = apply_filters( 'pwcc/index-now/key-location', $key_location, $url_list, $post );
242248

243249
$data = array(
244250
'host' => wp_parse_url( $key_location, PHP_URL_HOST ),

0 commit comments

Comments
 (0)