*/ class ACTLOGPRO_Activity_Log_Pro_Admin { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ public function __construct($plugin_name, $version) { $this->plugin_name = $plugin_name; $this->version = $version; } /** * Register the JavaScript for the admin area. * * @since 1.0.0 */ public function enqueue_scripts() { // Enqueue the main admin script wp_enqueue_script( 'activity-log-pro-admin', plugin_dir_url(__FILE__) . 'js/activity-log-pro-admin.js', array('jquery', 'jquery-ui-datepicker'), $this->version, false ); // Localize script for AJAX wp_localize_script( 'activity-log-pro-admin', 'actlogpro_ajax', array( 'nonce' => wp_create_nonce('actlogpro_ajax_nonce'), 'ajaxurl' => admin_url('admin-ajax.php') ) ); // Set script type to module for ES6 module support wp_script_add_data('activity-log-pro-admin', 'type', 'module'); // Enqueue jQuery UI styles for datepicker - use locally hosted version instead of external CDN wp_enqueue_style( 'jquery-ui-style', plugin_dir_url(__FILE__) . 'css/jquery-ui.min.css', array(), '1.12.1' ); } }