Skip to content

Commit d75152c

Browse files
authored
404: Pass correct get_site_url param to avoid infinite loop (#98)
The first param to `get_site_url()` should be a site ID, or `null` for the current site. Passing a string can cause a `switch_to_blog( 0 )` in some circumstances. That breaks SQL queries because the table doesn't exist. The first broken query results in a `wp_die()`, but that leads to more queries which in turn call `wp_die()`. Passing `null` fixes the error while preserving the original intent from #54 (comment).
1 parent 97609a6 commit d75152c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/wp-content/themes/wporg-parent-2021/patterns/404-page-subtitle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
printf(
1414
/* translators: %s is the site URL. */
1515
wp_kses_post( __( 'Go to <a href="%s">the homepage</a> or try searching using the field below.', 'wporg' ) ),
16-
esc_url( get_site_url( '/' ) )
16+
esc_url( get_site_url( null, '/' ) )
1717
);
1818
?>
1919
</p>

0 commit comments

Comments
 (0)