function delicious_load_scripts()
{
    if (is_active_widget(0, 0, 'slider-posts')) {
        wp_enqueue_script('cycle', $src = CHILD_URL . '/lib/js/jquery.cycle.all.min.js', array('jquery'), CHILD_THEME_VERSION, TRUE);
        wp_enqueue_script('delicious-scripts', $src = CHILD_URL . '/lib/js/delicious-scripts.js', array('jquery'), CHILD_THEME_VERSION, TRUE);
    }
}
Beispiel #2
0
 /**
  * Register widget with WordPress.
  */
 public function __construct()
 {
     parent::__construct('twitter_timeline', apply_filters('jetpack_widget_name', esc_html__('Twitter Timeline', 'jetpack')), array('classname' => 'widget_twitter_timeline', 'description' => __('Display an official Twitter Embedded Timeline widget.', 'jetpack')));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster')) {
         wp_enqueue_script('twitter-widgets', '//platform.twitter.com/widgets.js', '', '', true);
     }
 }
 /**
  * constructor
  */
 function HW_Taxonomy_Post_List_widget()
 {
     //Hoangweb Taxonomy Post List
     parent::WP_Widget(false, $name = "Truy xuất nội dung theo chuyên mục", array('description' => 'Hiển thị bài viết theo danh mục/taxonomy'));
     //you should check if whether this widget actived on frontend or neither maybe you can get widget data by get_option($this->option_name)
     if (!is_admin() && !is_active_widget(false, false, $this->id_base, true)) {
         return;
     }
     $this->setup_actions();
     //instance skin
     if (class_exists('HW_SKIN')) {
         $this->skin = new HW_SKIN($this, plugin_dir_path(__FILE__), self::SKINS_FOLDER, 'hw-category-posts.php', 'skins');
         //$this->skin->skin_name='hw-category-posts.php';   #/wp-contents/hw_yahooskype/yahooskype.php
         //$this->skin->skin_folder='wcp_hw_skins';   #create folder in /wp-contents/hw_yahooskype
         $this->skin->plugin_url = plugins_url('', __FILE__);
         $this->skin->enable_external_callback = false;
         $this->skin->create('pagination', '__paginations', 'hwtpl-pagination.php')->enable_external_callback = false;
         //create new skin for pagination
         //create scrollbar skins
         $this->skin->create('scrollbar', '__scrollbars', 'hwtpl-scrollbar.php')->enable_external_callback = false;
         $this->skin->enable_template_engine();
     }
     self::$instance = $this;
     //save lastest instance of this widget
     //register widget features from HW_AWC
     if (class_exists('HW_AWC')) {
         /*HW_AWC::register_widget_feature($this,'grid_posts');  //depricated
           HW_AWC::register_widget_feature($this, 'saveconfig');
           HW_AWC::register_widget_feature($this, 'fancybox');*/
     }
     $this->hwtpl = new HW_Taxonomy_Post_List();
     $this->hwtpl->localize_object_callback = array($this, '_set_localize_scripts_data');
 }
 /**
  * parse_request
  */
 public function init()
 {
     if (is_active_widget(FALSE, FALSE, $this->id_base, TRUE)) {
         global $wp;
         EED_Espresso_Calendar::instance()->run($wp);
     }
 }
Beispiel #5
0
 function __construct()
 {
     parent::__construct('wd_faq_widget', __('WD FAQ', 'wd-faq'), array('description' => __('Publish your frequently asked questions.', 'wd-faq')));
     if (is_active_widget(false, false, $this->id_base, true) and !is_admin()) {
         $this->load_widget_scripts();
     }
 }
 function __construct()
 {
     parent::__construct('akismet_widget', __('Akismet Widget'), array('description' => __('Display the number of spam comments Akismet has caught')));
     if (is_active_widget(false, false, $this->id_base)) {
         add_action('wp_head', array($this, 'css'));
     }
 }
 /**
  * Register widget with WordPress.
  */
 public function __construct()
 {
     parent::__construct('twitter_timeline', THEME_NAME . ' - ' . esc_html__('Twitter Timeline', 'lambda-admin-td'), array('classname' => 'widget_twitter_timeline', 'description' => __('Display an official Twitter Embedded Timeline widget.', 'lambda-admin-td')));
     if (is_active_widget(false, false, $this->id_base)) {
         add_action('wp_footer', array($this, 'library'));
     }
 }
Beispiel #8
0
 function __construct()
 {
     parent::__construct('twitter', apply_filters('jetpack_widget_name', __('Twitter', 'jetpack')), array('classname' => 'widget_twitter', 'description' => __('Display your Tweets from Twitter', 'jetpack')));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster')) {
         add_action('wp_head', array($this, 'style'));
     }
 }
function lexicon_load_scripts()
{
    if (is_active_widget(0, 0, 'feature-posts')) {
        wp_enqueue_script('cycle', $src = CHILD_URL . '/lib/js/jquery.cycle.all.min.js', array('jquery'), CHILD_THEME_VERSION, TRUE);
        wp_enqueue_script('lexicon-scripts', $src = CHILD_URL . '/lib/js/lexicon-scripts.js', array('jquery'), CHILD_THEME_VERSION, TRUE);
    }
}
 public function maybe_enqueue()
 {
     if (is_active_widget(false, false, $this->id_base)) {
         wp_enqueue_style('wp-strava-style');
         //only load this when wigit is loaded
     }
 }
 /**
  * 
  * a must function. you can not use it, but the function must stay there!
  */
 public static function onAddScripts()
 {
     global $wp_version;
     $slver = apply_filters('revslider_remove_version', RevSliderGlobals::SLIDER_REVISION);
     $style_pre = '';
     $style_post = '';
     if ($wp_version < 3.7) {
         $style_pre = '<style type="text/css">';
         $style_post = '</style>';
     }
     $operations = new RevSliderOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = RevSliderFunctions::getVal($arrValues, "includes_globally", "on");
     $includesFooter = RevSliderFunctions::getVal($arrValues, "js_to_footer", "off");
     $strPutIn = RevSliderFunctions::getVal($arrValues, "pages_for_includes");
     $isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
     //put the includes only on pages with active widget or shortcode
     // if the put in match, then include them always (ignore this if)
     if ($isPutIn == false && $includesGlobally == "off") {
         $isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
         $hasShortcode = RevSliderFunctionsWP::hasShortcode("rev_slider");
         if ($isWidgetActive == false && $hasShortcode == false) {
             return false;
         }
     }
     wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), $slver);
     $custom_css = RevSliderOperations::getStaticCss();
     $custom_css = RevSliderCssParser::compress_css($custom_css);
     if (trim($custom_css) == '') {
         $custom_css = '#rs-demo-id {}';
     }
     wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
     $setBase = is_ssl() ? "https://" : "http://";
     wp_enqueue_script(array('jquery'));
     //add icon sets
     //wp_register_style('rs-icon-set-fa-icon-', RS_PLUGIN_URL .'public/assets/fonts/font-awesome/css/font-awesome.css', array(), $slver);
     //wp_register_style('rs-icon-set-pe-7s-', RS_PLUGIN_URL .'public/assets/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css', array(), $slver);
     if ($includesFooter == "off") {
         $waitfor = array('jquery');
         $enable_logs = RevSliderFunctions::getVal($arrValues, "enable_logs", 'off');
         if ($enable_logs == 'on') {
             wp_enqueue_script('enable-logs', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.enablelog.js', $waitfor, $slver);
             $waitfor[] = 'enable-logs';
         }
         wp_enqueue_script('tp-tools', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js', $waitfor, $slver);
         wp_enqueue_script('revmin', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.revolution.min.js', 'tp-tools', $slver);
     } else {
         //put javascript to footer
         add_action('wp_footer', array('RevSliderFront', 'putJavascript'));
     }
     add_action('wp_head', array('RevSliderFront', 'add_meta_generator'));
     add_action("wp_footer", array('RevSliderFront', "load_icon_fonts"));
     // Async JS Loading
     $js_defer = RevSliderBase::getVar($arrValues, 'js_defer', 'off');
     if ($js_defer != 'off') {
         add_filter('clean_url', array('RevSliderFront', 'add_defer_forscript'), 11, 1);
     }
     add_action('wp_before_admin_bar_render', array('RevSliderFront', 'add_admin_menu_nodes'));
     add_action('wp_footer', array('RevSliderFront', 'putAdminBarMenus'));
 }
 function __construct()
 {
     parent::__construct('facebook-likebox', apply_filters('jetpack_widget_name', __('Facebook Page Plugin', 'jetpack')), array('classname' => 'widget_facebook_likebox', 'description' => __('Use the Facebook Page Plugin to connect visitors to your Facebook Page', 'jetpack'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster') || is_customize_preview()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     }
 }
Beispiel #13
0
 function __construct()
 {
     parent::__construct('upcoming_events_widget', apply_filters('jetpack_widget_name', __('Upcoming Events', 'jetpack')), array('description' => __('Display upcoming events from an iCalendar feed.', 'jetpack'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base)) {
         add_action('wp_head', array($this, 'css'));
     }
 }
 public function __construct()
 {
     parent::__construct('uw_facebook', $name = __('UW - Facebook', 'kho'), array('classname' => 'uw_widget_wrap uw_facebook_widget', 'description' => __('Adds support for Facebook Page Plugin.', 'kho')));
     if (is_active_widget(false, false, $this->id_base)) {
         add_action('wp_footer', array(&$this, 'uw_facebook_script'));
     }
 }
Beispiel #15
0
 function woothemes_add_javascript()
 {
     global $woo_options;
     wp_register_script('prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto.js', array('jquery'));
     wp_register_script('portfolio', get_template_directory_uri() . '/includes/js/portfolio.js', array('jquery', 'prettyPhoto'));
     wp_register_script('flexslider', get_template_directory_uri() . '/includes/js/jquery.flexslider.min.js', array('jquery'));
     wp_register_script('enable-lightbox', get_template_directory_uri() . '/includes/js/enable-lightbox.js', array('jquery', 'prettyPhoto'));
     // Feedback Scripts
     wp_register_script('slides', get_template_directory_uri() . '/includes/js/slides.min.jquery.js', array('jquery'));
     wp_register_script('woo-feedback', get_template_directory_uri() . '/includes/js/feedback.js', array('jquery', 'slides'));
     if ((is_home() || is_front_page()) && isset($woo_options['woo_featured']) && $woo_options['woo_featured'] == 'true') {
         wp_enqueue_script('flexslider');
     }
     if (is_page_template('template-portfolio.php') || is_front_page() || is_singular() && get_post_type() == 'portfolio' || is_tax('portfolio-gallery') || is_post_type_archive('portfolio')) {
         wp_enqueue_script('portfolio');
     }
     wp_enqueue_script('third-party', get_template_directory_uri() . '/includes/js/third-party.js', array('jquery'));
     wp_enqueue_script('general', get_template_directory_uri() . '/includes/js/general.js', array('jquery', 'third-party'));
     // Conditionally load the Feedback JavaScript, where needed.
     $load_feedback_js = false;
     // Allow child themes/plugins to load the Feedback JavaScript when they need it.
     $load_feedback_js = apply_filters('woo_load_feedback_js', $load_feedback_js);
     if ($load_feedback_js && (is_active_widget(false, false, 'woo_feedback', true) || is_page_template('template-feedback.php'))) {
         wp_enqueue_script('woo-feedback');
     }
     do_action('woothemes_add_javascript');
 }
 /**
  * Register widget with WordPress.
  */
 public function __construct()
 {
     parent::__construct('twitter_timeline', apply_filters('jetpack_widget_name', esc_html__('Twitter Timeline', 'jetpack')), array('classname' => 'widget_twitter_timeline', 'description' => __('Display an official Twitter Embedded Timeline widget.', 'jetpack')));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster')) {
         add_action('wp_footer', array($this, 'library'));
     }
 }
 /**
  * constructor
  */
 public function HW_LC_Taxonomy()
 {
     parent::WP_Widget('hwlct_taxonomy', $name = 'HW Liệt kê categories/taxonomy terms');
     //you should check if whether this widget actived on frontend or neither maybe you can get widget data by get_option($this->option_name)
     if (!is_admin() && !is_active_widget(false, false, $this->id_base, true)) {
         return;
     }
     if (!is_admin()) {
         HW_HOANGWEB::load_class('hwArray');
     }
     //init skins
     if (class_exists('HW_SKIN')) {
         $this->skin = new HW_SKIN($this, plugin_dir_path(__FILE__), 'hw_lct_skins', 'hwlct-skin.php', 'skins');
         #$this->skin->set_group('group1');
         $this->skin->plugin_url = plugins_url('', __FILE__);
         $this->skin->enable_external_callback = false;
         #$this->skin->getSavedCallbacksJs_data(array($this,'get_callbacks_data'));
         #$this->skin->create('t1')->files_skin_folder = 'images';    //set skin folder files
         #$this->skin->create('t2')->files_skin_folder = 'image1';    //set skin folder files
         #$this->skin->create('t3','group2','hwlct-pagi-skin.php');    //set skin folder files
         #$this->skin->get_skin_instance('t1')->getSavedCallbacksJs_data(array($this,'get_callbacks_data'));
         $this->skin->registerExternalStorage_JSCallback(array($this, 'save_callback_event'));
         $this->skin->enable_template_engine(1, 0);
         $this->skin->init();
     }
     if (class_exists('HW_AWC')) {
         /*HW_AWC::register_widget_feature($this,'grid_posts');  //dynamic config
           HW_AWC::register_widget_feature($this, 'fancybox');*/
     }
     $this->setup_actions();
 }
 /**
  * Register widget with WordPress.
  */
 public function __construct()
 {
     parent::__construct('image', apply_filters('jetpack_widget_name', esc_html__('Image', 'jetpack')), array('classname' => 'widget_image', 'description' => __('Display an image in your sidebar', 'jetpack')));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster')) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_style'));
     }
 }
 function __construct()
 {
     parent::__construct('Social_Counter', __('Social Counter'), array('description' => __('Display count number of each social media')));
     if (is_active_widget(false, false, $this->id_base)) {
         add_action('wp_head', array($this, 'css'));
     }
 }
Beispiel #20
0
 /**
  * 
  * a must function. you can not use it, but the function must stay there!.
  */
 public static function onAddScripts()
 {
     $operations = new BizOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = UniteFunctionsBiz::getVal($arrValues, "includes_globally", "on");
     $includesFooter = UniteFunctionsBiz::getVal($arrValues, "js_to_footer", "off");
     $strPutIn = UniteFunctionsBiz::getVal($arrValues, "pages_for_includes");
     $isPutIn = ShowBizOutput::isPutIn($strPutIn, true);
     $includeFancy = UniteFunctionsBiz::getVal($arrValues, "includes_globally_facybox", "on");
     //put the includes only on pages with active widget or shortcode
     // if the put in match, then include them always (ignore this if)
     if ($isPutIn == false && $includesGlobally == "off") {
         $isWidgetActive = is_active_widget(false, false, "showbiz-widget", true);
         $hasShortcode = UniteFunctionsWPBiz::hasShortcode("showbiz");
         if ($isWidgetActive == false && $hasShortcode == false) {
             return false;
         }
     }
     self::addStyle("settings", "showbiz-settings", "showbiz-plugin/css");
     $url_jquery = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=showbiz";
     self::addScriptAbsoluteUrl($url_jquery, "jquery");
     if ($includeFancy == "on") {
         self::addStyle("jquery.fancybox", "fancybox", "showbiz-plugin/fancybox");
         self::addScript("jquery.fancybox.pack", "showbiz-plugin/fancybox", "fancybox");
     }
     if ($includesFooter == "off") {
         $waitfor = array('jquery');
         self::addScript("jquery.themepunch.tools.min", "showbiz-plugin/js", 'tp-tools', $waitfor);
         self::addScript("jquery.themepunch.showbizpro.min", "showbiz-plugin/js");
     } else {
         //put javascript to footer
         UniteBaseClassBiz::addAction('wp_footer', 'putJavascript');
     }
 }
Beispiel #21
0
    function widget($args, $instance)
    {
        extract($args);
        /*Our variables from the widget settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $show_info = isset($instance['show_info']) ? $instance['show_info'] : false;
        global $is_floter;
        echo $before_widget;
        ?>
            <div class="sfsi_widget">   
				<div id='sfsi_wDiv'></div>
                    <?php 
        /* Display the widget title */
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        /* Link the main icons function */
        echo sfsi_check_visiblity(0);
        ?>
	      		<div style="clear: both;"></div>
            </div>
            <?php 
        if (is_active_widget(false, false, $this->id_base, true)) {
        }
        echo $after_widget;
    }
Beispiel #22
0
 /**
  * Constructor.
  *
  * @since Twenty Fourteen 1.0
  *
  * @return Twenty_Fourteen_Ephemera_Widget
  */
 public function __construct()
 {
     parent::__construct('widget_twentyfourteen_ephemera', __('Twenty Fourteen Ephemera', 'twentyfourteen'), array('classname' => 'widget_twentyfourteen_ephemera', 'description' => __('Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base) || is_customize_preview()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     }
 }
 /**
  * Layered Nav Init
  *
  * @package    WooCommerce/Widgets
  * @access     public
  * @return void
  */
 public function woocommerce_layered_nav_init()
 {
     if (is_active_widget(false, false, 'yith-woo-ajax-navigation', true) && !is_admin()) {
         global $_chosen_attributes, $woocommerce;
         $_chosen_attributes = array();
         /* FIX TO WOOCOMMERCE 2.1 */
         $attibute_taxonomies = function_exists('wc_get_attribute_taxonomies') ? $attribute_taxonomies = wc_get_attribute_taxonomies() : ($attribute_taxonomies = $woocommerce->get_attribute_taxonomies());
         if ($attribute_taxonomies) {
             foreach ($attribute_taxonomies as $tax) {
                 $attribute = wc_sanitize_taxonomy_name($tax->attribute_name);
                 /* FIX TO WOOCOMMERCE 2.1 */
                 if (function_exists('wc_attribute_taxonomy_name')) {
                     $taxonomy = wc_attribute_taxonomy_name($attribute);
                 } else {
                     $taxonomy = $woocommerce->attribute_taxonomy_name($attribute);
                 }
                 $name = 'filter_' . $attribute;
                 $query_type_name = 'query_type_' . $attribute;
                 if (!empty($_GET[$name]) && taxonomy_exists($taxonomy)) {
                     $_chosen_attributes[$taxonomy]['terms'] = explode(',', $_GET[$name]);
                     if (empty($_GET[$query_type_name]) || !in_array(strtolower($_GET[$query_type_name]), array('and', 'or'))) {
                         $_chosen_attributes[$taxonomy]['query_type'] = apply_filters('woocommerce_layered_nav_default_query_type', 'and');
                     } else {
                         $_chosen_attributes[$taxonomy]['query_type'] = strtolower($_GET[$query_type_name]);
                     }
                 }
             }
         }
         if (version_compare(preg_replace('/-beta-([0-9]+)/', '', $woocommerce->version), '2.1', '<')) {
             add_filter('loop_shop_post_in', 'woocommerce_layered_nav_query');
         } else {
             add_filter('loop_shop_post_in', array(WC()->query, 'layered_nav_query'));
         }
     }
 }
Beispiel #24
0
    function widget($args, $instance)
    {
        extract($args);
        //if show via widget is checked
        $sfsi_plus_section8_options = get_option("sfsi_plus_section8_options");
        $sfsi_plus_section8_options = unserialize($sfsi_plus_section8_options);
        $sfsi_plus_show_via_widget = $sfsi_plus_section8_options['sfsi_plus_show_via_widget'];
        if ($sfsi_plus_show_via_widget == "yes") {
            /*Our variables from the widget settings. */
            $title = apply_filters('widget_title', $instance['title']);
            $show_info = isset($instance['show_info']) ? $instance['show_info'] : false;
            global $is_floter;
            echo $before_widget;
            /* Display the widget title */
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
				<div class="sfsi_plus_widget" data-position="widget">   
					<div id='sfsi_plus_wDiv'></div>
						<?php 
            /* Link the main icons function */
            echo sfsi_plus_check_visiblity(0);
            ?>
                    <div style="clear: both;"></div>
				</div>
				<?php 
            if (is_active_widget(false, false, $this->id_base, true)) {
            }
            echo $after_widget;
        } else {
            //echo 'Kindly go to setting page and check the option "show them via a widget"';
        }
    }
Beispiel #25
0
/**
 * Display list of the available widgets, either all or matching search.
 *
 * The search parameter are search terms separated by spaces.
 *
 * @since unknown
 *
 * @param string $show Optional, default is all. What to display, can be 'all', 'unused', or 'used'.
 * @param string $_search Optional. Search for widgets. Should be unsanitized.
 */
function wp_list_widgets()
{
    global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls;
    $sort = $wp_registered_widgets;
    usort($sort, create_function('$a, $b', 'return strnatcasecmp( $a["name"], $b["name"] );'));
    $done = array();
    foreach ($sort as $widget) {
        if (in_array($widget['callback'], $done, true)) {
            // We already showed this multi-widget
            continue;
        }
        $sidebar = is_active_widget($widget['callback'], $widget['id'], false, false);
        $done[] = $widget['callback'];
        if (!isset($widget['params'][0])) {
            $widget['params'][0] = array();
        }
        $args = array('widget_id' => $widget['id'], 'widget_name' => $widget['name'], '_display' => 'template');
        if (isset($wp_registered_widget_controls[$widget['id']]['id_base']) && isset($widget['params'][0]['number'])) {
            $id_base = $wp_registered_widget_controls[$widget['id']]['id_base'];
            $args['_temp_id'] = "{$id_base}-__i__";
            $args['_multi_num'] = next_widget_id_number($id_base);
            $args['_add'] = 'multi';
        } else {
            $args['_add'] = 'single';
            if ($sidebar) {
                $args['_hide'] = '1';
            }
        }
        $args = wp_list_widget_controls_dynamic_sidebar(array(0 => $args, 1 => $widget['params'][0]));
        call_user_func_array('wp_widget_control', $args);
    }
}
 /**
  * Register widget with WordPress.
  */
 public function __construct()
 {
     parent::__construct('twitter_timeline', apply_filters('jetpack_widget_name', esc_html__('Twitter Timeline', 'jetpack')), array('classname' => 'widget_twitter_timeline', 'description' => __('Display an official Twitter Embedded Timeline widget.', 'jetpack'), 'customize_selective_refresh' => true));
     if (is_active_widget(false, false, $this->id_base) || is_active_widget(false, false, 'monster') || is_customize_preview()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     }
 }
 /** constructor */
 function rotatingtweets_Widget()
 {
     parent::WP_Widget(false, $name = 'Rotating Tweets', array('description' => __('A widget to show tweets for a particular user in rotation.', 'rotatingtweets')));
     if (is_active_widget(false, false, $this->id_base)) {
         rotatingtweets_enqueue_scripts();
     }
 }
Beispiel #28
0
/**
 * This function just gives active widgets a chance to enqueue their scripts
 */
function siteorigin_widgets_enqueue_widget_scripts()
{
    global $wp_registered_widgets, $post;
    $active_widgets = array();
    $panel_widget_classes = array();
    if (is_singular()) {
        $panels_data = get_post_meta($post->ID, 'panels_data', true);
    } elseif (function_exists('siteorigin_panels_is_home') && siteorigin_panels_is_home()) {
        $panels_data = get_option('siteorigin_panels_home_page', null);
    }
    if (!empty($panels_data['widgets'])) {
        foreach ($panels_data['widgets'] as $widget) {
            $panel_widget_classes[] = $widget['info']['class'];
        }
    }
    foreach ($wp_registered_widgets as $widget) {
        if (!empty($widget['callback'][0]) && is_object($widget['callback'][0])) {
            if (is_active_widget(false, false, $widget['callback'][0]->id_base)) {
                $active_widgets[] = $widget['callback'][0]->id_base;
            }
            if (!empty($panel_widget_classes) && in_array(get_class($widget['callback'][0]), $panel_widget_classes)) {
                $active_widgets[] = $widget['callback'][0]->id_base;
            }
        }
    }
    $active_widgets = array_unique($active_widgets);
    foreach ($active_widgets as $widget) {
        do_action('siteorigin_enqueue_widget_scripts_' . $widget);
    }
}
function wplms_dashboard_template()
{
    if (!is_user_logged_in()) {
        wp_redirect(site_url());
    }
    $template = 'templates/dashboard';
    global $bp;
    if ($bp->current_component == 'dashboard') {
        wp_enqueue_style('wplms-dashboard-css', WPLMS_DASHBOARD_URL . '/css/wplms-dashboard.css', array(), '1.0');
        wp_enqueue_script('wplms-dashboard-js', WPLMS_DASHBOARD_URL . '/js/wplms-dashboard.js', array('jquery', 'jquery-ui-sortable'), '1.0');
        if (is_active_widget(false, false, 'wplms_instructor_dash_stats', true) || is_active_widget(false, false, 'wplms_dash_stats', true)) {
            wp_enqueue_script('wplms-sparkline', WPLMS_DASHBOARD_URL . '/js/jquery.sparkline.min.js', array('jquery'), true);
        }
        if (is_active_widget(false, false, 'wplms_instructor_stats', true) || is_active_widget(false, false, 'wplms_instructor_commission_stats', true) || is_active_widget(false, false, 'wplms_student_stats', true)) {
            wp_enqueue_script('wplms-raphael', WPLMS_DASHBOARD_URL . '/js/raphael-min.js', array('jquery'), true);
            wp_enqueue_script('wplms-morris', WPLMS_DASHBOARD_URL . '/js/morris.min.js', array('jquery'), true);
        }
        $translation_array = array('earnings' => __('Earnings', 'wplms-dashboard'), 'payout' => __('Payout', 'wplms-dashboard'), 'students' => __('# Students', 'wplms-dashboard'), 'saved' => __('SAVED', 'wplms-dashboard'), 'saving' => __('SAVING ...', 'wplms-dashboard'), 'stats_calculated' => __('Stats Calculated, reloading page ...', 'wplms-dashboard'));
        wp_localize_script('wplms-dashboard-js', 'wplms_dashboard_strings', $translation_array);
    }
    $located_template = apply_filters('bp_located_template', locate_template($template, false), $template);
    if ($located_template && $located_template != '') {
        bp_get_template_part(apply_filters('bp_load_template', $located_template));
    } else {
        bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/dashboard'));
    }
}
Beispiel #30
0
function yit_revslider_slider()
{
    $operations = new RevOperations();
    $arrValues = $operations->getGeneralSettingsValues();

    $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");

    $isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
    $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");

    if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) {
        return;
    }

    wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION);

    $custom_css = RevOperations::getStaticCss();
    $custom_css = UniteCssParserRev::compress_css($custom_css);
    wp_add_inline_style('rs-plugin-settings', $custom_css);

    $setBase = (is_ssl()) ? "https://" : "http://";

    $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
    wp_enqueue_script("jquery", $url_jquery);

    // put javascript to footer
    add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}