$final_form_id ]); // Enqueue external Jotform script with explicit version wp_enqueue_script( 'jotform-agent', 'https://cdn.jotfor.ms/s/umd/latest/for-embedded-agent.js', [], '1.0.0', // Replace with real version if known true ); // Enqueue localized internal script wp_enqueue_script($script_handle); } add_action('wp_enqueue_scripts', 'ai_agent_enqueue_scripts'); add_action('admin_enqueue_scripts', 'ai_agent_enqueue_scripts'); // Color Picker Call function ai_agent_enqueue_color_picker($hook_suffix) { wp_enqueue_style('wp-color-picker'); // Define script path and URL $script_rel_path = 'js/color-picker.js'; $script_dir_path = plugin_dir_path(dirname(__FILE__)) . $script_rel_path; $script_url = plugin_dir_url(dirname(__FILE__)) . $script_rel_path; $script_version = file_exists($script_dir_path) ? filemtime($script_dir_path) : '1.0.0'; // Enqueue script with explicit version wp_enqueue_script( 'ai-agent-color-picker', $script_url, array('wp-color-picker', 'jquery'), $script_version, true ); } add_action('admin_enqueue_scripts', 'ai_agent_enqueue_color_picker'); ?>