/** * Add all scripts required on the front-end */ public function addScript() { $o = $this->options; if (is_front_page() && !empty($o['display_on_homepage']) || is_archive() && !empty($o['display_on_archive']) || is_single() && !empty($o['display_on_post']) || is_page() && !empty($o['display_on_page'])) { wp_register_style('arevico_scsfbcss', plugins_url('includes/front/scs/scs.css', __FILE__)); wp_enqueue_style('arevico_scsfbcss'); wp_register_script('arevico_scsfb', plugins_url('includes/front/scs/scs.js', __FILE__), array('jquery')); wp_enqueue_script('arevico_scsfb'); wp_register_script('arevico_scsfb_launch', plugins_url('includes/front/js/launch.js', __FILE__), array('jquery')); wp_enqueue_script('arevico_scsfb_launch'); wp_localize_script('arevico_scsfb_launch', 'lb_l_ret', arvlbSHARED::normalize($o)); } }
/** * Add all scripts required on the front-end */ public function addScript() { $o = $this->options; if (is_front_page() && !empty($o['display_on_homepage']) || is_archive() && !empty($o['display_on_archive']) || is_single() && !empty($o['display_on_post']) || is_page() && !empty($o['display_on_page']) || !empty($_GET['lightbox'])) { add_action('wp_footer', array($this, 'add_footer')); if (empty($o['performance'])) { add_action('wp_head', array($this, "scompat_head"), -999); } //lower order corresponds with earlier execution wp_register_style('arevico_scsfbcss', plugins_url('includes/front/scs/scs.css', __FILE__)); wp_enqueue_style('arevico_scsfbcss'); wp_register_script('arevico_scsfb', plugins_url('includes/front/scs/scs.js', __FILE__), array('jquery')); wp_enqueue_script('arevico_scsfb'); wp_register_script('arevico_scsfb_launch', plugins_url('includes/front/js/launch.js', __FILE__), array('jquery')); wp_enqueue_script('arevico_scsfb_launch'); wp_localize_script('arevico_scsfb_launch', 'lb_l_ret', arvlbSHARED::normalize($o)); } }