apply_filters( 'pre_wp_is_site_initialized', bool|null $pre, int $site_id )
- Since
- 5.1.0
Filters the check for whether a site is initialized before the database is accessed.
Description
Returning a non-null value will effectively short-circuit the function, returning that value instead.
Compatibility
- WordPress
- since 5.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$prebool|null- The value to return instead. Default null to continue with the check.
$site_idint- The site ID that is being checked.
Where this hook fires · 1
wp-includes/ms-site.php:926wp_is_site_initialized()
Source code
* @since 5.1.0 * * @param bool|null $pre The value to return instead. Default null * to continue with the check. * @param int $site_id The site ID that is being checked. */ $pre = apply_filters( 'pre_wp_is_site_initialized', null, $site_id ); if ( null !== $pre ) { return (bool) $pre; } $switch = false; if ( get_current_blog_id() !== $site_id ) {Changelog
Introduced in 5.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.