@@ -556,58 +556,4 @@ function osi_handle_supporter_form_flamingo_spam_status_change( string $new_stat
556556 }
557557 }
558558}
559- add_action ( 'transition_post_status ' , 'osi_handle_supporter_form_flamingo_spam_status_change ' , 10 , 3 );
560-
561- function enqueue_ai_template_assets () {
562- // Debug: Check if function is running
563- echo "<script>console.log('Enqueue function running');</script> " ;
564-
565- // Get the template slug and full path
566- $ template_slug = get_page_template_slug ();
567- $ template_path = get_template_directory () . '/ ' . $ template_slug ;
568- echo "<script>console.log('Template slug: " . $ template_slug . "');</script> " ;
569- echo "<script>console.log('Template path: " . $ template_path . "');</script> " ;
570-
571- // Check if either the template slug contains our template name or if it's the full path
572- if (strpos ($ template_slug , 'ai-fse.php ' ) !== false ) {
573- echo "<script>console.log('Template condition met');</script> " ;
574-
575- // FontAwesome
576- wp_enqueue_style ('fontawesome ' , 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css ' , array (), '6.5.1 ' );
577-
578- // Other CSS files
579- wp_enqueue_style ('swiper ' , 'https://opensourceorg.github.io/ai/assets/css/plugins/swiper.css ' , array (), '1.0.0 ' );
580- wp_enqueue_style ('unicons ' , 'https://opensourceorg.github.io/ai/assets/css/plugins/unicons.css ' , array (), '1.0.0 ' );
581- wp_enqueue_style ('metismenu ' , 'https://opensourceorg.github.io/ai/assets/css/plugins/metismenu.css ' , array (), '1.0.0 ' );
582- wp_enqueue_style ('animate ' , 'https://opensourceorg.github.io/ai/assets/css/vendor/animate.css ' , array (), '1.0.0 ' );
583- wp_enqueue_style ('bootstrap ' , 'https://opensourceorg.github.io/ai/assets/css/vendor/bootstrap.min.css ' , array (), '1.0.0 ' );
584- wp_enqueue_style ('ai-custom ' , 'https://opensourceorg.github.io/ai/assets/css/style.css ' , array ('bootstrap ' ), '1.0.0 ' );
585-
586- // JavaScript files with proper dependencies
587- wp_enqueue_script ('jquery ' );
588- wp_enqueue_script ('jqueryui ' , 'https://opensourceorg.github.io/ai/assets/js/vendor/jqueryui.js ' , array ('jquery ' ), '1.0.0 ' , true );
589- wp_enqueue_script ('counter-up ' , 'https://opensourceorg.github.io/ai/assets/js/plugins/counter-up.js ' , array ('jquery ' ), '1.0.0 ' , true );
590- wp_enqueue_script ('swiper-js ' , 'https://opensourceorg.github.io/ai/assets/js/plugins/swiper.js ' , array ('jquery ' ), '1.0.0 ' , true );
591- wp_enqueue_script ('metismenu-js ' , 'https://opensourceorg.github.io/ai/assets/js/plugins/metismenu.js ' , array ('jquery ' ), '1.0.0 ' , true );
592- wp_enqueue_script ('waypoint ' , 'https://opensourceorg.github.io/ai/assets/js/vendor/waypoint.js ' , array ('jquery ' ), '1.0.0 ' , true );
593- wp_enqueue_script ('waw ' , 'https://opensourceorg.github.io/ai/assets/js/vendor/waw.js ' , array ('jquery ' ), '1.0.0 ' , true );
594- wp_enqueue_script ('gsap ' , 'https://opensourceorg.github.io/ai/assets/js/plugins/gsap.min.js ' , array (), '1.0.0 ' , true );
595- wp_enqueue_script ('scrolltrigger ' , 'https://opensourceorg.github.io/ai/assets/js/plugins/scrolltigger.js ' , array ('gsap ' ), '1.0.0 ' , true );
596- wp_enqueue_script ('split-text ' , 'https://opensourceorg.github.io/ai/assets/js/vendor/split-text.js ' , array ('gsap ' ), '1.0.0 ' , true );
597- wp_enqueue_script ('contact-form ' , 'https://opensourceorg.github.io/ai/assets/js/vendor/contact.form.js ' , array ('jquery ' ), '1.0.0 ' , true );
598- wp_enqueue_script ('split-type ' , 'https://opensourceorg.github.io/ai/assets/js/vendor/split-type.js ' , array (), '1.0.0 ' , true );
599- wp_enqueue_script ('jquery-timepicker ' , 'https://opensourceorg.github.io/ai/assets/js/plugins/jquery-timepicker.js ' , array ('jquery ' ), '1.0.0 ' , true );
600- wp_enqueue_script ('bootstrap-js ' , 'https://opensourceorg.github.io/ai/assets/js/plugins/bootstrap.min.js ' , array ('jquery ' ), '1.0.0 ' , true );
601- wp_enqueue_script ('ai-main ' , 'https://opensourceorg.github.io/ai/assets/js/main.js ' , array ('jquery ' , 'bootstrap-js ' ), '1.0.0 ' , true );
602- } else {
603- echo "<script>console.log('Template condition not met');</script> " ;
604- }
605- }
606- add_action ('wp_enqueue_scripts ' , 'enqueue_ai_template_assets ' );
607-
608- // Add this function to check if the template is being used
609- function check_template_usage ($ template ) {
610- echo "<script>console.log('Template being used: " . $ template . "');</script> " ;
611- return $ template ;
612- }
613- add_filter ('template_include ' , 'check_template_usage ' );
559+ add_action ( 'transition_post_status ' , 'osi_handle_supporter_form_flamingo_spam_status_change ' , 10 , 3 );
0 commit comments