Changeset 3232088
- Timestamp:
- 01/30/2025 02:44:06 PM (14 months ago)
- File:
-
- 1 edited
-
agent700-ai-chat/trunk/agent700-ai-chat.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
agent700-ai-chat/trunk/agent700-ai-chat.php
r3232072 r3232088 20 20 { 21 21 if (get_option('agent700_model') && get_option('agent700_chat_api_url') && get_option('agent700_agent_id')) { 22 wp_enqueue_style('agent700-styles', plugins_url('styles/styles.css', __FILE__), array(), '1.0.0');23 wp_enqueue_script('agent700-chat', plugins_url('scripts/agent-chat.js', __FILE__), array(), '1.0.0', true);22 wp_enqueue_style('agent700-styles', home_url('/wp-content/plugins/agent700-ai-chat/styles/styles.css'), array(), '1.1'); 23 wp_enqueue_script('agent700-chat', home_url('/wp-content/plugins/agent700-ai-chat/scripts/agent-chat.js'), array(), '1.1', true); 24 24 } 25 25 } … … 287 287 } 288 288 289 // Hook to enqueue scripts and styles in WordPress290 add_action('wp_enqueue_scripts', 'agent700_enqueue_assets');291 292 function agent700_enqueue_assets() {293 // Define paths to assets294 $plugin_url = plugin_dir_url(__FILE__);295 296 // Enqueue CSS297 wp_enqueue_style('agent700-chat-style', $plugin_url . 'styles/chat-style.css', array(), '1.0.0', 'all');298 299 // Enqueue JavaScript300 wp_enqueue_script('agent700-chat-script', $plugin_url . 'scripts/chat-script.js', array('jquery'), '1.0.0', true);301 302 // Add inline styles or scripts if necessary303 /* $custom_css = "304 .chat-agent-icon {305 background-color: #f0f0f0;306 }307 "; */308 // wp_add_inline_style('agent700-chat-style', $custom_css);309 310 $custom_js = "311 document.addEventListener('DOMContentLoaded', function() {312 console.log('Agent700 script loaded');313 });314 ";315 wp_add_inline_script('agent700-chat-script', $custom_js);316 }317 318 289 function agent700_chat_icon_field_render() { 319 290 $chat_icon = get_option('agent700_chat_icon');
Note: See TracChangeset
for help on using the changeset viewer.