コード例 #1
0
 function twitterwidget()
 {
     $widget_ops = array('classname' => 'twitterwidget', 'description' => 'Your twitter recent post list here.');
     // $control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'TwitterWidget-widget');
     // parent::WP_Widget(false, $name = 'WenderHost Subpages', $widget_ops);
     parent::WP_Widget(false, 'recent Twitter posts', $widget_ops);
 }
コード例 #2
0
 function cart_menu()
 {
     $widget_ops = array('classname' => 'cart_menu_class', 'description' => 'Show a bar with custom cart for woocommerce');
     wp_register_style('style.css', CART_MENU__PLUGIN_URL . 'css/style.css');
     wp_enqueue_style('style.css');
     parent::WP_Widget(false, $name = __('Woocommerce Cart Widget', 'wp_cart_menu'));
 }
コード例 #3
0
 /** 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();
     }
 }
コード例 #4
0
 function htIntraverts()
 {
     parent::WP_Widget(false, __('HT Intraverts', 'govintranet'), array('description' => __('Displays an individual spot from a selection of spots and hides from user if already viewed', 'govintranet')));
     /*
     Load css
     */
     wp_enqueue_style('intraverts', plugins_url("/ht-intraverts-ajax/css/ht_intraverts.css"));
     /*
     Register intravert custom post type
     */
     add_action('init', 'cptui_register_my_cpt_intravert');
     function cptui_register_my_cpt_intravert()
     {
         register_post_type('intravert', array('label' => 'Intraverts', 'description' => '', 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => array('slug' => 'intravert', 'with_front' => true), 'query_var' => true, 'has_archive' => true, 'exclude_from_search' => true, 'menu_position' => '30', 'menu_icon' => 'dashicons-welcome-view-site', 'supports' => array('title', 'editor', 'excerpt', 'revisions', 'thumbnail', 'author', 'page-attributes'), 'labels' => array('name' => 'Intraverts', 'singular_name' => 'Intravert', 'menu_name' => 'Intraverts', 'add_new' => __('Add Intravert', 'govintranet'), 'add_new_item' => __('Add New Intravert', 'govintranet'), 'edit' => __('Edit', 'govintranet'), 'edit_item' => __('Edit Intravert', 'govintranet'), 'new_item' => __('New Intravert', 'govintranet'), 'view' => __('View Intravert', 'govintranet'), 'view_item' => __('View Intravert', 'govintranet'), 'search_items' => __('Search Intraverts', 'govintranet'), 'not_found' => __('No Intraverts Found', 'govintranet'), 'not_found_in_trash' => __('No Intraverts Found in Trash', 'govintranet'), 'parent' => __('Parent Intravert', 'govintranet'))));
     }
     /*
     Register Advanced Custom Fields for the intraverts custom post type
     */
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_5494c172a5fb9', 'title' => 'Intraverts', 'fields' => array(array('key' => 'field_5494c635e6e0e', 'label' => __('Link text', 'govintranet'), 'name' => 'intravert_link_text', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_5494c648e6e0f', 'label' => __('Intranet destination page', 'govintranet'), 'name' => 'intravert_destination_page', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => '', 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type', 2 => 'taxonomy'), 'elements' => array(0 => 'featured_image'), 'max' => 1, 'return_format' => 'id'), array('key' => 'field_54bc153f9a49c', 'label' => 'Cookie period', 'name' => 'intravert_cookie_period', 'prefix' => '', 'type' => 'number', 'instructions' => 'The number of days before the intravert will reappear after being viewed. Default is 14 days.', 'required' => 0, 'conditional_logic' => 0, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'min' => '', 'max' => '', 'step' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_5494c1c796832', 'label' => __('Date range', 'govintranet'), 'name' => 'intravert_date_range', 'prefix' => '', 'type' => 'true_false', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'message' => '', 'default_value' => 0), array('key' => 'field_5494c21a96833', 'label' => __('Start date', 'govintranet'), 'name' => 'intravert_start_date', 'prefix' => '', 'type' => 'date_picker', 'instructions' => '', 'required' => 1, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c1c796832', 'operator' => '==', 'value' => '1'))), 'display_format' => 'd/m/Y', 'return_format' => 'd/m/Y', 'first_day' => 1), array('key' => 'field_5494c25596834', 'label' => __('End date', 'govintranet'), 'name' => 'intravert_end_date', 'prefix' => '', 'type' => 'date_picker', 'instructions' => '', 'required' => 1, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c1c796832', 'operator' => '==', 'value' => '1'))), 'display_format' => 'd/m/Y', 'return_format' => 'd/m/Y', 'first_day' => 1), array('key' => 'field_5494c18696831', 'label' => __('Target logged in users', 'govintranet'), 'name' => 'intravert_logged_in_only', 'prefix' => '', 'type' => 'true_false', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'message' => '', 'default_value' => 0), array('key' => 'field_5494d7fd784af', 'label' => __('Contributors and above', 'govintranet'), 'name' => 'intravert_contributors', 'prefix' => '', 'type' => 'true_false', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_0' => array('field' => 'field_5494c18696831', 'operator' => '==', 'value' => '1'))), 'message' => '', 'default_value' => 0), array('key' => 'field_5494c2af96836', 'label' => __('Teams', 'govintranet'), 'name' => 'intravert_teams', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c18696831', 'operator' => '==', 'value' => '1'))), 'post_type' => array(0 => 'team'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => '', 'max' => '', 'return_format' => 'object'), array('key' => 'field_5494c30696837', 'label' => __('Grades', 'govintranet'), 'name' => 'intravert_grades', 'prefix' => '', 'type' => 'taxonomy', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_rule_0' => array('field' => 'field_5494c18696831', 'operator' => '==', 'value' => '1'))), 'taxonomy' => 'grade', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'object', 'multiple' => 0), array('key' => 'field_5494c29196835', 'label' => __('Target content', 'govintranet'), 'name' => 'intravert_target_content', 'prefix' => '', 'type' => 'select', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'choices' => array('All' => 'All', 'Task category' => 'Task category', 'News type' => 'News type'), 'default_value' => array(), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'placeholder' => '', 'disabled' => 0, 'readonly' => 0), array('key' => 'field_5494d3330049d', 'label' => __('Task category', 'govintranet'), 'name' => 'intravert_category', 'prefix' => '', 'type' => 'taxonomy', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_rule_rule_0' => array('field' => 'field_5494c29196835', 'operator' => '==', 'value' => 'Task category'))), 'taxonomy' => 'category', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'id', 'multiple' => 0), array('key' => 'field_5494d775784ae', 'label' => __('News type', 'govintranet'), 'name' => 'intravert_news_type', 'prefix' => '', 'type' => 'taxonomy', 'instructions' => '', 'required' => 0, 'conditional_logic' => array(array('rule_rule_0' => array('field' => 'field_5494c29196835', 'operator' => '==', 'value' => 'News type'))), 'taxonomy' => 'news-type', 'field_type' => 'checkbox', 'allow_null' => 0, 'load_save_terms' => 0, 'return_format' => 'id', 'multiple' => 0)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'intravert'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
         /*
         Register Advanced Custom Fields for the intraverts widget
         */
         register_field_group(array('key' => 'group_54c2f059881dc', 'title' => __('Intraverts widget', 'govintranet'), 'fields' => array(array('key' => 'field_54c2f09fa63e3', 'label' => __('Eligible intraverts', 'govintranet'), 'name' => 'eligible_intraverts', 'prefix' => '', 'type' => 'relationship', 'instructions' => __('Choose which intraverts are eligible to appear in this widget area.', 'govintranet'), 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'intravert'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => array(0 => 'featured_image'), 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htintraverts'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
コード例 #5
0
ファイル: widget-footer-box.php プロジェクト: unisexx/drtooth
 /** constructor */
 function footer_box_widget()
 {
     global $themename;
     $widget_options = array('classname' => 'footer_box_widget', 'description' => 'Displays Box with some content');
     $control_options = array('width' => 342);
     parent::WP_Widget('medicenter_footer_box', __('Footer Box', 'medicenter'), $widget_options, $control_options);
 }
コード例 #6
0
ファイル: single-image.php プロジェクト: uw-sop/htdocs
 function UW_Widget_Single_Image()
 {
     parent::WP_Widget($id = 'pic-text', $name = 'Single Image', $options = array('description' => 'Display an image with some featured text.', 'classname' => 'pic-text-widget'));
     if (is_admin()) {
         add_action('admin_enqueue_scripts', array(__CLASS__, 'scripts'));
     }
 }
コード例 #7
0
 function ThemetonTabContainerWidget()
 {
     $widget_ops = array('classname' => 'ThemetonTabContainerWidget', 'description' => 'Recent posts with Thumbnail.');
     // $control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'TwitterWidget-widget');
     // parent::WP_Widget(false, $name = 'WenderHost Subpages', $widget_ops);
     parent::WP_Widget(false, 'Themeton tabbed widgets', $widget_ops);
 }
コード例 #8
0
 function sociallinkswidget()
 {
     $widget_ops = array('classname' => 'sociallinkswidget', 'description' => 'Please enter your social site accounts.', 'social_title' => 'Enter the Title for you Social links');
     // $control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'TwitterWidget-widget');
     // parent::WP_Widget(false, $name = 'WenderHost Subpages', $widget_ops);
     parent::WP_Widget(false, 'Themeton social links', $widget_ops);
 }
コード例 #9
0
 function htMostActive()
 {
     parent::WP_Widget(false, __('HT Most active', 'govintranet'), array('description' => __('Display pages with most pageviews', 'govintranet')));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54c3150a2b558', 'title' => __('Most active widget', 'govintranet'), 'fields' => array(array('key' => 'field_55327bd9f4f3d', 'label' => __('Show guide chapters', 'govintranet'), 'name' => 'show_guide_chapters', 'prefix' => '', 'type' => 'true_false', 'instructions' => __('If enabled, this option will show individual guide chapters. If disabled, only main guide pages will appear.', 'govintranet'), 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'message' => '', 'default_value' => 0), array('key' => 'field_54c31510b4670', 'label' => __('Exclude', 'govintranet'), 'name' => 'exclude_posts', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'post_type' => '', 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htmostactive'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
コード例 #10
0
 /** constructor */
 function home_box_widget()
 {
     global $themename;
     $widget_options = array('classname' => 'home_box_widget', 'description' => 'Displays Box with some content');
     $control_options = array('width' => 460);
     parent::WP_Widget('gymbase_home_box', __('Home Box', $themename), $widget_options, $control_options);
 }
コード例 #11
0
 function Wdfb_WidgetConnect()
 {
     $widget_ops = array('classname' => __CLASS__, 'description' => __('Shows Facebook Connect box.', 'wdfb'));
     add_action('wp_print_styles', array($this, 'css_load_styles'));
     add_action('wp_print_scripts', array($this, 'js_load_scripts'));
     parent::WP_Widget(__CLASS__, 'Facebook Connect', $widget_ops);
 }
コード例 #12
0
 /** constructor */
 function departments_widget()
 {
     global $themename;
     $widget_options = array('classname' => 'departments_widget', 'description' => 'Displays Departments Accordion');
     $control_options = array('width' => 460);
     parent::WP_Widget('medicenter_departments', __('Departments Accordion', 'medicenter'), $widget_options, $control_options);
 }
コード例 #13
0
 /**
  * constructor
  */
 public function HW_Yahoo_Skype_status()
 {
     parent::WP_Widget(false, $name = __('Online yahoo skype status', 'hwyk'), array('description' => __('Display yahoo skype status widget.', 'hwyk')));
     //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;
     }
     //instance skin
     if (class_exists('HW_SKIN')) {
         $this->skin = new HW_SKIN($this, HW_YK_PLUGIN_PATH, 'hw_yahooskype', 'yahooskype.php', 'skins');
         $this->skin->plugin_url = HW_YK_PLUGIN_URL;
         $this->skin->create('phone_icons', 'resources')->set_resource_path_skins('phone-icons');
         //create phones icon skin manager
         $this->skin->create('mail_icons', 'resources')->set_resource_path_skins('mail-icons');
         //create mail icon skin manager
         $this->skin->create('yahoo_icons', 'resources')->set_resource_path_skins('yahoo-icons');
         //create yahoo icon skin manager
         $this->skin->create('skype_icons', 'resources')->set_resource_path_skins('skype-icons');
         //create skype icon skin manager
         //$this->skin->create('avatars','resources')->set_resource_path_skins('avatars'); //avatars image
         $this->skin->get_skin_instance('phone_icons')->enable_external_callback = false;
         $this->skin->get_skin_instance('mail_icons')->enable_external_callback = false;
         $this->skin->get_skin_instance('yahoo_icons')->enable_external_callback = false;
         $this->skin->get_skin_instance('skype_icons')->enable_external_callback = false;
         //$this->skin->get_skin_instance('avatars')->enable_external_callback = false;
         $this->skin->enable_template_engine();
     }
     //ajax callback
     #add_action("wp_ajax_hw_yahooskype_add_contact", array('HW_Yahoo_Skype_status',"add_new"));
     #add_action("wp_ajax_nopriv_hw_yahooskype_add_contact", array('HW_Yahoo_Skype_status',"add_new"));
     add_action('admin_enqueue_scripts', array(&$this, '_admin_enqueue_scripts'));
 }
コード例 #14
0
 /**
  * Constructor.
  */
 function __construct()
 {
     // Set up optional widget args
     $widget_ops = array('classname' => 'widget_bp_follow_following_widget widget buddypress', 'description' => __("Show a list of member avatars that the logged-in user is following.", 'bp-follow'));
     // Set up the widget
     parent::WP_Widget(false, __("(BP Follow) Users I'm Following", 'bp-follow'), $widget_ops);
 }
コード例 #15
0
 /**
  * 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();
 }
コード例 #16
0
ファイル: widget-twitter.php プロジェクト: unisexx/drtooth
 /** constructor */
 function twitter_widget()
 {
     global $themename;
     $widget_options = array('classname' => 'twitter_widget', 'description' => 'Displays Twitter Feed');
     $control_options = array('width' => 580);
     parent::WP_Widget('medicenter_twitter', __('Twitter Feed', 'medicenter'), $widget_options, $control_options);
 }
コード例 #17
0
 /**
  * Constructs and initialize the Google Maps meta box
  */
 public function Pronamic_Google_Maps_Widget()
 {
     $description = __('Use this widget to add an Google Maps as a widget.', 'pronamic_google_maps');
     $widgetOptions = array('classname' => 'pronamic_google_maps_widget', 'description' => $description);
     $controlOptions = array('width' => 500);
     parent::WP_Widget('pronamic_google_maps', __('Google Maps', 'pronamic_google_maps'), $widgetOptions, $controlOptions);
 }
コード例 #18
0
 function htAboutThisPage()
 {
     parent::WP_Widget(false, 'HT About this page', array('description' => 'Display page metadata'));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54c8168128e72', 'title' => 'About this page widget', 'fields' => array(array('key' => 'field_54c816872d1e0', 'label' => 'Display also on children of:', 'name' => 'about_this_page_children', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'page'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htaboutthispage'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
コード例 #19
0
ファイル: em-events.php プロジェクト: batruji/metareading
 /** constructor */
 function EM_Widget()
 {
     $this->defaults = array('title' => __('Events', 'dbem'), 'scope' => 'future', 'order' => 'ASC', 'limit' => 5, 'category' => 0, 'format' => '#_EVENTLINK<ul><li>#_EVENTDATES</li><li>#_LOCATIONTOWN</li></ul>', 'nolistwrap' => false, 'orderby' => 'event_start_date,event_start_time,event_name', 'all_events' => 0, 'all_events_text' => __('all events', 'dbem'), 'no_events_text' => __('No events', 'dbem'));
     $this->em_orderby_options = apply_filters('em_settings_events_default_orderby_ddm', array('event_start_date,event_start_time,event_name' => __('start date, start time, event name', 'dbem'), 'event_name,event_start_date,event_start_time' => __('name, start date, start time', 'dbem'), 'event_name,event_end_date,event_end_time' => __('name, end date, end time', 'dbem'), 'event_end_date,event_end_time,event_name' => __('end date, end time, event name', 'dbem')));
     $widget_ops = array('description' => __("Display a list of events on Events Manager.", 'dbem'));
     parent::WP_Widget(false, $name = 'Events', $widget_ops);
 }
コード例 #20
0
 function htFeatureNews()
 {
     parent::WP_Widget(false, 'HT Feature news', array('description' => 'Display feature news stories'));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54bfacd48f6e7', 'title' => 'Feature news widget', 'fields' => array(array('key' => 'field_54c03e5d0f3f4', 'label' => 'Pin stories', 'name' => 'pin_stories', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'news', 1 => 'blog', 2 => 'event'), 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'max' => '', 'return_format' => 'id'), array('key' => 'field_54bfacd9a9fbb', 'label' => 'Exclude stories', 'name' => 'exclude_stories', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => array(0 => 'news'), 'taxonomy' => '', 'filters' => array(0 => 'search'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htfeaturenews'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'seamless', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
コード例 #21
0
 function html_javascript_adder_widget()
 {
     $widget_ops = array('classname' => 'widget_html_javascript_adder', 'description' => __("Insert HTML, Javascripts, shortcodes and other codes in the sidebar", 'hja'));
     $control_ops = array('width' => 480, 'height' => 500);
     parent::WP_Widget('html_javascript_adder', __('HTML Javascript Adder', 'hja'), $widget_ops, $control_ops);
     if (is_admin()) {
         // Get plugin options
         $hja = get_option('widget_html_javascript_adder');
         // Rename old array keys @since v3.5
         if (is_array($hja) && !isset($hja['_varscleaned'])) {
             $toRep = array('hja_', 'is_', 'diable_post');
             $repWith = array('', 'hide_', 'hide_in_posts');
             foreach ($hja as $k => $v) {
                 if (is_array($v)) {
                     foreach ($v as $m => $n) {
                         $old = $m;
                         $new = str_replace($toRep, $repWith, $old);
                         $hja[$k][$new] = $hja[$k][$old];
                         unset($hja[$k][$old]);
                     }
                 }
             }
             $hja['_varscleaned'] = true;
             update_option('widget_html_javascript_adder', $hja);
         }
         // Include plugin version in options
         if (is_array($hja) && !isset($hja['_version']) || $hja['_version'] != HJA_VERSION) {
             $hja['_version'] = HJA_VERSION;
             update_option('widget_html_javascript_adder', $hja);
         }
     }
 }
コード例 #22
0
 /** constructor */
 function SlideshowWidget()
 {
     parent::WP_Widget(false, $name = 'Sidebar Slideshow');
     $widget_ops = array('classname' => 'slideshow_widget', 'description' => __('WPPA+ Sidebar Slideshow', 'wppa'));
     //
     $this->WP_Widget('slideshow_widget', __('Sidebar Slideshow', 'wppa'), $widget_ops);
 }
コード例 #23
0
 /** constructor */
 function EM_Locations_Widget()
 {
     $this->defaults = array('title' => __('Event Locations', 'dbem'), 'scope' => 'future', 'order' => 'ASC', 'limit' => 5, 'format' => '<li>#_LOCATIONLINK<ul><li>#_LOCATIONADDRESS</li><li>#_LOCATIONTOWN</li></ul></li>', 'no_locations_text' => '<li>' . __('No locations', 'dbem') . '</li>', 'orderby' => 'event_start_date,event_start_time,location_name');
     $this->em_orderby_options = array('event_start_date, event_start_time, location_name' => __('Event start date/time, location name', 'dbem'), 'location_name' => __('Location name', 'dbem'));
     $widget_ops = array('description' => __("Display a list of event locations on Events Manager.", 'dbem'));
     parent::WP_Widget(false, $name = 'Event Locations', $widget_ops);
 }
コード例 #24
0
ファイル: class.uw-cards.php プロジェクト: jh1uw/uw-2014
 function __construct()
 {
     parent::WP_Widget($id = 'uw-widget-cards', $name = 'Image Cards', $options = array('description' => 'Choose from several styles of cards', 'classname' => 'cards-widget'));
     if (is_admin()) {
         add_action('admin_enqueue_scripts', array(__CLASS__, 'scripts'));
     }
 }
コード例 #25
0
ファイル: twitter.php プロジェクト: Juni4567/meritscholarship
 /** constructor */
 function ReallySimpleTwitterWidget()
 {
     $this->languagePath = basename(dirname(__FILE__)) . '/languages';
     load_plugin_textdomain('vibe', 'false', $this->languagePath);
     $this->options = array(array('name' => 'title', 'label' => __('Title', 'vibe'), 'type' => 'text'), array('name' => 'style', 'label' => __('Select Twitter Style', 'vibe'), 'type' => 'select', 'options' => array('default', 'horizontal')), array('name' => 'link_title', 'label' => __('Link above Title with Twitter user', 'vibe'), 'type' => 'checkbox'), array('name' => 'consumer_key', 'label' => __('Consumer Key', 'vibe') . '<small><br />' . __('Create your Twitter Application', 'vibe') . ' <a href="https://dev.twitter.com/apps" target="_blank">' . __('here', 'vibe') . '</a></small>', 'type' => 'text', 'default' => ''), array('name' => 'consumer_secret', 'label' => __('Consumer Secret', 'vibe'), 'type' => 'text', 'default' => ''), array('name' => 'access_token', 'label' => __('Access Token', 'vibe'), 'type' => 'text', 'default' => ''), array('name' => 'access_token_secret', 'label' => __('Access Token Secret', 'vibe'), 'type' => 'text', 'default' => ''), array('name' => 'username', 'label' => __('Twitter Username', 'vibe'), 'type' => 'text'), array('name' => 'num', 'label' => __('Show # of Tweets', 'vibe'), 'type' => 'text'), array('name' => 'update', 'label' => __('Show timestamps', 'vibe'), 'type' => 'checkbox'), array('name' => 'hyperlinks', 'label' => __('Find and show hyperlinks', 'vibe'), 'type' => 'checkbox'), array('name' => 'twitter_users', 'label' => __('Find Replies in Tweets', 'vibe'), 'type' => 'checkbox'), array('name' => 'link_target_blank', 'label' => __('Create links on new window / tab', 'vibe'), 'type' => 'checkbox'));
     parent::WP_Widget(false, $name = 'Vibe Twitter Widget');
 }
コード例 #26
0
 function htFeatureBlogposts()
 {
     parent::WP_Widget(false, __('HT Feature blogposts', 'govintranet'), array('description' => __('Blogpost listing widget', 'govintranet')));
     if (function_exists('acf_add_local_field_group')) {
         acf_add_local_field_group(array('key' => 'group_562a555eac132', 'title' => __('Feature blog widget', 'govintranet'), 'fields' => array(array('key' => 'field_562a555eb8501', 'label' => _x('Pin posts', 'Make stories sticky and appear at the top', 'govintranet'), 'name' => 'pin_posts', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'post_type' => array(0 => 'news', 1 => 'blog', 2 => 'event'), 'taxonomy' => array(), 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'min' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htfeatureblogposts'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'seamless', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => '', 'active' => 1, 'description' => ''));
     }
 }
コード例 #27
0
 function WidgetFacebookLikeBox()
 {
     $widget_ops = array('classname' => 'FacebookLikeBox', 'description' => 'Adciona uma caixa de likes de sua página no Facebook');
     wp_register_script('facebook_like_form', network_site_url() . 'wp-content/mu-plugins/includes/widgets/js/facebook-like.js', array('jquery'));
     wp_enqueue_script('facebook_like_form');
     parent::WP_Widget('facebookLikeBox', 'Facebook LikeBox', $widget_ops);
 }
コード例 #28
0
 function htMostRecent()
 {
     parent::WP_Widget(false, __('HT MostRecent', 'govintranet'), array('description' => __('Display most recent posts', 'govintranet')));
     if (function_exists('register_field_group')) {
         register_field_group(array('key' => 'group_54c30b1243bd6', 'title' => _x('Most recent widget', 'Widget that lists the most recent posts', 'govintranet'), 'fields' => array(array('key' => 'field_54c30b1d69d24', 'label' => __('Exclude', 'govintranet'), 'name' => 'exclude_posts', 'prefix' => '', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'post_type' => '', 'taxonomy' => '', 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'max' => '', 'return_format' => 'id')), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htmostrecent'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
コード例 #29
0
 /**
  * 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');
 }
コード例 #30
0
 function htFeatureNews()
 {
     parent::WP_Widget(false, __('HT Feature news', 'govintranet'), array('description' => __('Display feature news stories', 'govintranet')));
     if (function_exists('acf_add_local_field_group')) {
         acf_add_local_field_group(array('key' => 'group_54bfacd48f6e7', 'title' => __('Feature news widget', 'govintranet'), 'fields' => array(array('key' => 'field_560c502fb460c', 'label' => _x('News type', 'Categories for news', 'govintranet'), 'name' => 'news_listing_news_type', 'type' => 'taxonomy', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'taxonomy' => 'news-type', 'field_type' => 'checkbox', 'allow_null' => 1, 'add_term' => 0, 'save_terms' => 0, 'load_terms' => 0, 'return_format' => 'id', 'multiple' => 0), array('key' => 'field_54c03e5d0f3f4', 'label' => _x('Pin stories', 'Make news stories sticky and appear at the top', 'govintranet'), 'name' => 'pin_stories', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'post_type' => array(0 => 'news', 1 => 'blog', 2 => 'event'), 'taxonomy' => array(), 'filters' => array(0 => 'search', 1 => 'post_type'), 'elements' => '', 'max' => '', 'return_format' => 'id', 'min' => 0), array('key' => 'field_54bfacd9a9fbb', 'label' => __('Exclude stories', 'govintranet'), 'name' => 'exclude_stories', 'type' => 'relationship', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'post_type' => array(0 => 'news'), 'taxonomy' => array(), 'filters' => array(0 => 'search'), 'elements' => '', 'max' => '', 'return_format' => 'id', 'min' => 0)), 'location' => array(array(array('param' => 'widget', 'operator' => '==', 'value' => 'htfeaturenews'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'seamless', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => '', 'active' => 1, 'description' => ''));
     }
 }