/**
 * Automatically trigger Starter Templates sync if local sub-site cache is empty
 */
add_action( 'admin_init', 'auto_sync_starter_templates_on_first_load' );

function auto_sync_starter_templates_on_first_load() {
    // Only run for site administrators on the starter-templates page
    if ( ! current_user_can( 'manage_options' ) ) {
        return;
    }

    if ( isset( $_GET['page'] ) && $_GET['page'] === 'starter-templates' ) {
        // Check if the primary template transient exists on this sub-site
        $templates = get_site_transient( 'astra_sites_batch_is_complete' );

        if ( false === $templates && class_exists( 'Astra_Sites_Batch_Processing' ) ) {
            // Trigger the internal sync process programmatically
            if ( method_exists( 'Astra_Sites_Batch_Processing', 'get_instance' ) ) {
                Astra_Sites_Batch_Processing::get_instance()->import_all_categories_and_tags();
            }
        }
    }
}<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://farzana.lab.nextonlearning.com/wp-sitemap.xsl" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://farzana.lab.nextonlearning.com/2026/09/25/hello-world/</loc><lastmod>2026-09-25T10:14:10+00:00</lastmod></url></urlset>
