本文整理汇总了PHP中is_active_widget函数的典型用法代码示例。如果您正苦于以下问题:PHP is_active_widget函数的具体用法?PHP is_active_widget怎么用?PHP is_active_widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_active_widget函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delicious_load_scripts
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);
}
}
示例2: __construct
/**
* 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);
}
}
示例3: HW_Taxonomy_Post_List_widget
/**
* 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');
}
示例4: init
/**
* parse_request
*/
public function init()
{
if (is_active_widget(FALSE, FALSE, $this->id_base, TRUE)) {
global $wp;
EED_Espresso_Calendar::instance()->run($wp);
}
}
示例5: __construct
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();
}
}
示例6: __construct
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'));
}
}
示例7: __construct
/**
* 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'));
}
}
示例8: __construct
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'));
}
}
示例9: lexicon_load_scripts
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);
}
}
示例10: maybe_enqueue
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
}
}
示例11: onAddScripts
/**
*
* 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'));
}
示例12: __construct
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'));
}
}
示例13: __construct
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'));
}
}
示例14: __construct
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'));
}
}
示例15: woothemes_add_javascript
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');
}