$locale_file = WP_LANG_DIR . "/$locale.php";
if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) {
* WordPress Locale object for loading locale domain date and various strings.
* @global WP_Locale $wp_locale WordPress date and time locale object.
$GLOBALS['wp_locale'] = new WP_Locale();
* WordPress Locale Switcher object for switching locales.
* @global WP_Locale_Switcher $wp_locale_switcher WordPress locale switcher object.
$GLOBALS['wp_locale_switcher'] = new WP_Locale_Switcher();
$GLOBALS['wp_locale_switcher']->init();
// Load the functions for the active theme, for both parent and child theme if applicable.
foreach ( wp_get_active_and_valid_themes() as $theme ) {
if ( file_exists( $theme . '/functions.php' ) ) {
include $theme . '/functions.php';
* Fires after the theme is loaded.
do_action( 'after_setup_theme' );
// Create an instance of WP_Site_Health so that Cron events may fire.
if ( ! class_exists( 'WP_Site_Health' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
WP_Site_Health::get_instance();
* Fires after WordPress has finished loading but before any headers are sent.
* Most of WP is loaded at this stage, and the user is authenticated. WP continues
* to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate
* themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
* If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below.
* This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
* Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for
* @link https://codex.wordpress.org/AJAX_in_Plugins
do_action( 'wp_loaded' );