/** * Load assets. */ public function load_assets() { wp_register_style('hl-admin-css', $this->plugin->url() . '/includes/css/heyloyalty.css', array(), $this->plugin->version()); wp_register_script('hl-admin-js', $this->plugin->url() . '/includes/js/heyloyalty.js', array('jquery'), $this->plugin->version(), true); wp_register_script('hl-ajax-request', $this->plugin->url() . '/includes/js/heyloyalty-ajax.js', array('jquery')); wp_enqueue_script('hl-ajax-request'); wp_enqueue_script('hl-admin-js'); wp_enqueue_style('hl-admin-css'); wp_enqueue_script('jquery-ui-draggable', false, array('jquery')); wp_enqueue_script('jquery-ui-droppable', false, array('jquery')); wp_localize_script('hl-ajax-request', 'HLajax', array('ajaxurl' => admin_url('admin-ajax.php'))); }
/** * Load plugin styles */ public function load_assets() { $pre_suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; // stylesheets wp_register_style('scroll-triggered-boxes', $this->plugin->url('/assets/css/styles' . $pre_suffix . '.css'), array(), $this->plugin->version()); // scripts wp_register_script('scroll-triggered-boxes', $this->plugin->url('/assets/js/script' . $pre_suffix . '.js'), array('jquery'), $this->plugin->version(), true); // Finally, enqueue style. wp_enqueue_style('scroll-triggered-boxes'); wp_enqueue_script('scroll-triggered-boxes'); $this->pass_box_options(); do_action('stb_load_assets', $this); }