/** * 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(); } } } } Hello world! – Digital marketer

1 thought on “Hello world!”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top