function language_selector_widget_init() { wp_register_sidebar_widget('icl_lang_sel_widget', __('Language Selector', 'sitepress'), 'language_selector_widget', array('classname' => 'icl_languages_selector')); wp_register_widget_control('icl_lang_sel_widget_control', __('Language Selector', 'sitepress'), array(&$this, 'set_widget')); add_action('template_redirect', 'icl_lang_sel_nav_ob_start', 0); add_action('wp_head', 'icl_lang_sel_nav_ob_end'); }
function init() { if (!($options = get_option('widget_stray_quotes'))) { $options = array(); } $widget_ops = array('classname' => 'widget_stray_quotes', 'description' => ''); $control_ops = array('width' => 650, 'height' => 100, 'id_base' => 'stray_widgets'); $name = 'Quotes'; $registered = false; foreach (array_keys($options) as $o) { if (!isset($options[$o]['title'])) { continue; } $id = "stray_widgets-{$o}"; //check if the widgets is active global $wpdb; $sql = "SELECT option_value FROM {$wpdb->options} WHERE option_name = 'sidebars_widgets' AND option_value like '%" . $id . "%'"; $var = $wpdb->get_var($sql); //do this to keep the size of the array down if (!$var) { unset($options[$o]); } $registered = true; wp_register_sidebar_widget($id, $name, array(&$this, 'widget'), $widget_ops, array('number' => $o)); wp_register_widget_control($id, $name, array(&$this, 'control'), $control_ops, array('number' => $o)); } if (!$registered) { wp_register_sidebar_widget('stray_widgets-1', $name, array(&$this, 'widget'), $widget_ops, array('number' => -1)); wp_register_widget_control('stray_widgets-1', $name, array(&$this, 'control'), $control_ops, array('number' => -1)); } update_option('widget_stray_quotes', $options); }
function __construct($name, $params = array()) { parent::__construct($params); $this->name = $name; $this->id = strtolower(get_class($this)); $options = get_option($this->id); // register_sidebar_widget($this->name,array(&$this,'renderWidget')); $doesOwnConfig = $this->param('doesOwnConfig', false); $desc = $this->param('description', $this->name); $widget_ops = array('classname' => $this->id, 'description' => __($desc)); $control_ops = array('width' => 400, 'height' => 350, 'id_base' => $this->id); $name = $this->name; $id = false; do { if ($options) { foreach (array_keys($options) as $o) { // Old widgets can have null values for some reason if (!isset($options[$o]['exists'])) { continue; } $id = "{$this->id}-" . abs($o); // Never never never translate an id wp_register_sidebar_widget($id, $name, array(&$this, 'renderWidget'), $widget_ops, array('number' => $o)); wp_register_widget_control($id, $name, array(&$this, 'configForm'), $control_ops, array('number' => $o)); } } $options = array(-1 => array('exists' => 1)); } while (!$id); }
function ss_menu_widget_init() { if (!($options = get_option('ssMenu_widget_options'))) { $options = array(); } $control_ops = array('width' => 380, 'height' => 400, 'id_base' => 'ss_menu'); $widget_ops = array('classname' => 'ss_menu', 'description' => __('Animated expanding / fold down category menu to show subcategories and posts')); $name = __('SuperSlider Menu'); $id = false; foreach (array_keys($options) as $o) { // Old widgets can have null values for some reason if (!isset($options[$o]['title']) || !isset($options[$o]['title'])) { continue; } $id = "ss_menu-{$o}"; // Never never never translate an id wp_register_sidebar_widget($id, $name, 'ss_menu_widget', $widget_ops, array('number' => $o)); wp_register_widget_control($id, $name, 'ss_menu_widgetControl', $control_ops, array('number' => $o)); } // If there are none, we register the widget's existance with a generic template if (!$id) { wp_register_sidebar_widget('ss_menu-1', $name, 'ss_menu_widget', $widget_ops, array('number' => -1)); wp_register_widget_control('ss_menu-1', $name, 'ss_menu_widgetControl', $control_ops, array('number' => -1)); } }
/** * Function to register the Widget functions */ function register_widget() { $name = __('NextGEN Media RSS', 'nggallery'); $control_ops = array('width' => 250, 'height' => 350, 'id_base' => 'ngg-mrssw'); $widget_ops = array('classname' => 'ngg_mrssw', 'description' => __('Widget that displays Media RSS links for NextGEN Gallery.', 'nggallery')); if (!is_array($this->options)) { $this->options = array(); } $registered = false; foreach (array_keys($this->options) as $o) { // Old widgets can have null values for some reason //-- if (!isset($this->options[$o]['show_global_mrss'])) { continue; } // $id should look like {$id_base}-{$o} //-- $id = "ngg-mrssw-{$o}"; $registered = true; wp_register_sidebar_widget($id, $name, array(&$this, 'render_widget'), $widget_ops, array('number' => $o)); wp_register_widget_control($id, $name, array(&$this, 'render_control_panel'), $control_ops, array('number' => $o)); } // If there are none, we register the widget's existance with a generic template //-- if (!$registered) { wp_register_sidebar_widget('ngg-mrssw-1', $name, array(&$this, 'render_widget'), $widget_ops, array('number' => -1)); wp_register_widget_control('ngg-mrssw-1', $name, array(&$this, 'render_control_panel'), $control_ops, array('number' => -1)); } }
/** * */ function widget_sidebar_init() { if (!function_exists("wp_register_sidebar_widget")) { return; } wp_register_sidebar_widget("Widget-Menu-DokuMummy", "Menu DokuMummy", "viewMenu", array('description' => 'Stellt das Menu von DokuMummy dar.')); }
public static function init() { wp_register_sidebar_widget(LastTrackPlugin::PREFIX, __('Shoutcast last tracks', LastTrackPlugin::domain()), array(__CLASS__, 'draw')); wp_register_widget_control(LastTrackPlugin::PREFIX, __('Shoutcast last tracks', LastTrackPlugin::domain()), array(__CLASS__, 'settings')); add_action('wp_ajax_nopriv_' . LastTrackPlugin::PREFIX, array(__CLASS__, 'ajax')); add_action('wp_ajax_' . LastTrackPlugin::PREFIX, array(__CLASS__, 'ajax')); }
function init() { global $wp_version; global $advman_engine; $ads = $advman_engine->getAds(); if (!empty($ads)) { $widgets = array(); foreach ($ads as $id => $ad) { if (!empty($ad->name)) { $i = substr(md5($ad->name), 0, 10); $widgets[$i] = $ad; } } foreach ($widgets as $id => $ad) { $n = __('Ad: ', 'advman') . $ad->name; $description = __('An ad from the Advertising Manager plugin'); $args = array('name' => $n, 'description' => $description); if (function_exists('wp_register_sidebar_widget')) { //$id, $name, $output_callback, $options = array() wp_register_sidebar_widget("advman-{$id}", $n, array('Advman_Widget', 'widget'), $args, $ad->name); wp_register_widget_control("advman-{$id}", $n, array('Advman_Widget', 'widget_control'), null, null, $ad->name); } elseif (function_exists('register_sidebar_module')) { register_sidebar_module($n, array('Advman_Widget', 'sbm_widget'), "advman-{$id}", $args); register_sidebar_module_control($n, array('Advman_Widget', 'widget_control'), "advman-{$id}"); } } } }
function fadtastic_widget_init() { register_sidebar(array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>", 'name' => 'Sidebar 1', 'id' => 'main-sidebar')); register_sidebar(array('before_title' => "<h3 class='widgettitle'>", 'after_title' => "</h3>", 'name' => 'Sidebar 2', 'id' => 'bottom-bar')); unregister_widget('WP_Widget_Links'); wp_register_sidebar_widget('links', __('Links', 'sandbox'), 'widget_fadtastic_links'); }
function ocpwp_widget_generator_init() { wp_register_sidebar_widget('ocpwp_widget_1', 'Opencart Category Display', 'ocpwp_widget_category_display', array('description' => 'Displays list of category from Opencart store')); wp_register_widget_control('ocpwp_widget_1', 'Opencart Category Display', 'ocpwp_widget_category_control'); wp_register_sidebar_widget('ocpwp_widget_2', 'Opencart Product Display', 'ocpwp_widget_product_display', array('description' => 'Displays list of product from Opencart store')); wp_register_widget_control('ocpwp_widget_2', 'Opencart Product Display', 'ocpwp_widget_product_control'); }
function register_widget() { global $text_domain; global $wp_registered_widgets, $wp_registered_widget_controls; wp_register_sidebar_widget('via_posts', __('Latest about Store Locator for WordPress', SL_TEXT_DOMAIN), array(&$this, 'widget'), array('all_link' => 'http://www.viadat.com/category/store-locator', 'feed_link' => 'http://feeds.feedburner.com/viadat', 'edit_link' => 'options.php')); $wp_registered_widget_controls['via_posts'] = $wp_registered_widgets['via_posts']; }
function register_widget() { $piereg = get_option('pie_register_2'); if (current_user_can('manage_options')) { wp_register_sidebar_widget('piereg_invite_tracking', __('PR Code Tracking', 'piereg'), array($this, 'widget'), array('settings' => 'options-general.php?page=pie-register')); } }
function gfci_wall_multi_register() { if (!($options = get_option('wall_widget_gfci'))) { $options = array(); } $widget_ops = array('classname' => 'wall_widget_gfci', 'description' => __('Add a Google Friend Connect Wall Gadget')); $control_ops = array('width' => 420, 'height' => 420, 'id_base' => 'gfciwall'); $name = __('GFC Comments'); $registered = false; foreach (array_keys($options) as $o) { // Old widgets can have null values for some reason if (!isset($options[$o]['gadget_wid'])) { continue; } $id = "gfciwall-{$o}"; // Never never never translate an id $registered = true; wp_register_sidebar_widget($id, $name, 'GFCIWidget_Wall', $widget_ops, array('number' => $o)); wp_register_widget_control($id, $name, 'widget_gfci_wall_control', $control_ops, array('number' => $o)); } // If there are none, we register the widget's existance with a generic template if (!$registered) { wp_register_sidebar_widget('gfciwall-1', $name, 'GFCIWidget_Wall', $widget_ops, array('number' => -1)); wp_register_widget_control('gfciwall-1', $name, 'widget_gfci_wall_control', $control_ops, array('number' => -1)); } }
/** * Registers the TubePress widget with WordPress. * * @return void */ public static function initAction() { $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $msg = $ioc->get('org_tubepress_api_message_MessageService'); $widgetOps = array('classname' => 'widget_tubepress', 'description' => $msg->_('widget-description')); wp_register_sidebar_widget('tubepress', 'TubePress', array('org_tubepress_impl_env_wordpress_Widget', 'printWidget'), $widgetOps); wp_register_widget_control('tubepress', 'TubePress', array('org_tubepress_impl_env_wordpress_Widget', 'printControlPanel')); }
function quentin_widgets_init() { register_sidebars(1); unregister_widget('WP_Widget_Search'); unregister_widget('WP_Widget_Calendar'); wp_register_sidebar_widget('calendar', __('Calendar'), 'widget_quentin_calendar'); wp_register_sidebar_widget('search', __('Search'), 'widget_quentin_search'); }
public function registerWidget() { $description = "The most recent posted videos and comments in your blog"; $options = array("classname" => "widget_text", "description" => $description); $id = "all-in-one-video-pack-widget"; $name = "Recent Videos Widget"; wp_register_sidebar_widget($id, $name, $this->callback('displayWidget'), $options); }
function widgetInit() { global $quoteRotator, $management; if (!function_exists('wp_register_sidebar_widget')) { return; } wp_register_sidebar_widget('flexi-quote-rotator', 'Flexi Quote Rotator', array(&$quoteRotator, 'displayWidget')); wp_register_widget_control('flexi-quote-rotator', 'Flexi Quote Rotator', array(&$management, 'displayWidgetControl')); }
/** * Registers the TubePress widget with WordPress. * * @return void */ public static function initAction() { $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $msg = $ioc->get(org_tubepress_api_message_MessageService::_); $widgetOps = array('classname' => 'widget_tubepress', 'description' => $msg->_('Displays YouTube or Vimeo videos with TubePress')); //>(translatable)< wp_register_sidebar_widget('tubepress', 'TubePress', array('org_tubepress_impl_env_wordpress_Widget', 'printWidget'), $widgetOps); wp_register_widget_control('tubepress', 'TubePress', array('org_tubepress_impl_env_wordpress_Widget', 'printControlPanel')); }
function __construct() { $this->upgra_options(); $this->load_options(); $this->define_constants(); $this->load_dependencies(); register_activation_hook(plugin_basename(dirname(__FILE__)) . '/auto-anchor-list.php', array(&$this, 'activate')); wp_register_sidebar_widget('idbal16', 'Better Anchor Links', array(&$this, 'widget')); }
function load_widgets() { for ($pos = 1; $pos <= $this->widget_max; $pos++) { wp_register_sidebar_widget($this->id($pos), $this->name($pos), $pos <= $this->widget_available ? array(&$this, 'show_display') : '', $this->args(), $pos); if ($this->has_config()) { wp_register_widget_control($this->id($pos), $this->name($pos), $pos <= $this->widget_available ? array(&$this, 'show_config') : '', $this->args(), $pos); } } }
function jal_on_plugins_loaded() { if (function_exists('register_sidebar_widget')) { $widget_ops = array('classname' => 'widget_wordspew', 'description' => __('Add a shoutbox on your site', wordspew)); wp_register_sidebar_widget("shoutbox", __('Shoutbox', wordspew), 'widget_wordspew', $widget_ops); } if (function_exists('wp_register_widget_control')) { wp_register_widget_control("shoutbox", __('Shoutbox', wordspew), 'widget_wordspew_control', $widget_ops); } }
function bp_blogs_register_widgets() { global $current_blog; /* Latest Posts Widget */ wp_register_sidebar_widget('buddypress-blogs', __('Recent Blog Posts', 'buddypress'), 'bp_blogs_widget_recent_posts'); wp_register_widget_control('buddypress-blogs', __('Recent Blog Posts', 'buddypress'), 'bp_blogs_widget_recent_posts_control'); if (is_active_widget('bp_blogs_widget_recent_posts')) { wp_enqueue_style('bp-blogs-widget-posts-css', BP_PLUGIN_URL . '/bp-blogs/css/widget-blogs.css'); } }
function bp_activity_register_widgets() { global $current_blog; /* Site Wide Activity Widget */ wp_register_sidebar_widget('buddypress-activity', __('Site Wide Activity', 'buddypress'), 'bp_activity_widget_sitewide_activity'); wp_register_widget_control('buddypress-activity', __('Site Wide Activity', 'buddypress'), 'bp_activity_widget_sitewide_activity_control'); if (is_active_widget('bp_activity_widget_sitewide_activity')) { wp_enqueue_style('bp-activity-widget-activity-css', BP_PLUGIN_URL . '/bp-activity/css/widget-activity.css'); } }
/** * Initialize the vCita widget by registering the widget hooks */ function vcita_init() { if (!function_exists('register_sidebar_widget') || !function_exists('register_widget_control')) { return; } vcita_initialize_data(); wp_register_sidebar_widget('vcita_widget_id', 'vCita Sidebar Widget', 'vcita_widget_content'); wp_register_widget_control('vcita_widget_id', 'vCita Sidebar Widget', 'vcita_widget_admin'); add_filter('plugin_action_links', 'vcita_add_settings_link', 10, 2); register_uninstall_hook(VCITA_WIDGET_UNIQUE_LOCATION, 'vcita_uninstall'); }
function chaostheory_widgets_init() { register_sidebars(2, array('before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>')); unregister_widget('WP_Widget_Search'); unregister_widget('WP_Widget_Links'); unregister_widget('WP_Widget_Meta'); wp_register_sidebar_widget('search', __('Search', 'chaostheory'), 'widget_chaostheory_search'); wp_register_sidebar_widget('meta', __('Meta', 'chaostheory'), 'widget_chaostheory_meta'); wp_register_sidebar_widget('links', __('Links', 'chaostheory'), 'widget_chaostheory_links'); wp_register_sidebar_widget('home-link', __('Home Link', 'chaostheory'), 'widget_sandbox_homelink'); wp_register_sidebar_widget('rss-links', __('RSS Links', 'chaostheory'), 'widget_sandbox_rsslinks'); }
/** * bp_component_register_widgets() * * This function will register your widgets so that they will show up on the widget list * for site administrators to drop into their widget zones. */ function bp_chat_register_widgets() { global $current_blog; /* Site welcome widget */ wp_register_sidebar_widget('buddypress-chat', __('Cool Chat Widget', 'bp-chat'), 'bp_chat_widget_cool_widget'); wp_register_widget_control('buddypress-chat', __('Cool Chat Widget', 'bp-chat'), 'bp_chat_widget_cool_widget_control'); /* Include the javascript and /or CSS needed for activated widgets only. If none needed, this code can be left out. */ if (is_active_widget('bp_chat_widget_cool_widget')) { wp_enqueue_script('bp_chat_widget_cool_widget-js', WP_PLUGIN_URL . '/bp-chat/js/widget-chat.js', array('jquery', 'jquery-livequery-pack')); wp_enqueue_style('bp_chat_widget_cool_widget-css', WP_PLUGIN_URL . '/bp-chat/css/widget-chat.css'); } }
function groups_register_widgets() { global $current_blog; /* Site welcome widget */ wp_register_sidebar_widget('buddypress-groups', __('Groups', 'buddypress'), 'groups_widget_groups_list'); wp_register_widget_control('buddypress-groups', __('Groups', 'buddypress'), 'groups_widget_groups_list_control'); /* Include the javascript needed for activated widgets only */ if (is_active_widget('groups_widget_groups_list')) { wp_enqueue_script('groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery', 'jquery-livequery-pack')); wp_enqueue_style('groups_widget_members-css', BP_PLUGIN_URL . '/bp-groups/css/widget-groups.css'); } }
function acf_widget_area_filter_widgets($widgets) { global $wp_widget_factory, $wp_registered_widgets, $wp_registered_sidebars; if (is_single() || is_page()) { $object_id = get_queried_object_id(); $this->_page_widgets[$object_id] = array(); $this->_page_widget_instances[$object_id] = array(); $customized_sidebars = get_post_meta($object_id, 'acf_widget_area_is_customized', true); if (!empty($customized_sidebars)) { foreach (array_keys($wp_registered_sidebars) as $sidebar_id) { if (isset($customized_sidebars[$sidebar_id])) { foreach ($customized_sidebars[$sidebar_id] as $field_key => $customized) { $post_id = false; if ($customized == 'yes') { $post_id = $object_id; } elseif ($customized == 'inherit') { $cp = get_post($object_id); while ($cp && $cp->post_parent !== 0) { $cp = get_post($cp->post_parent); $parent_sidebars = get_post_meta($cp->ID, 'acf_widget_area_is_customized', true); if ($parent_sidebars && isset($parent_sidebars[$sidebar_id]) && $parent_sidebars[$sidebar_id][$field_key] == 'yes') { $post_id = $cp->ID; break; } } } if ($post_id) { $widgets[$sidebar_id] = array(); $value = get_field($field_key, $post_id); $field = get_field_object($field_key); if ($value && isset($value['rows'])) { foreach ($value['rows'] as $layout_row) { $the_widget_id = array_values($layout_row)[1]['widget_id']; $the_widget_class = array_values($layout_row)[1]['the_widget']; $instance = array_values($layout_row)[1]['instance']; $this->_page_widgets[$object_id] = $layout_row; if (!empty($wp_widget_factory->widgets[$the_widget_class])) { $widget = $wp_widget_factory->widgets[$the_widget_class]; $widgets[$sidebar_id][] = $the_widget_id; wp_register_sidebar_widget($the_widget_id, $widget->name, array($this, 'display_callback'), $widget->widget_options, array('instance' => $instance, 'widget' => $widget)); } } } } } } } } } return $widgets; }
function hmt_set_up_vars() { global $themename, $shortname, $options, $baseversion, $thisversion, $subtitle, $preset_mode; /* Admin Page Variables -------------------------------------------------------------- */ $themename = "HeatMap"; $subtitle = "adsense-theme-for-wordpress"; $baseversion = "2"; $thisversion = "2.5.4"; $shortname = "hmt"; $options = array(array("name" => "Activate Preset Mode", "desc" => "", "id" => $shortname . "_preset_mode_activated", "std" => "ON", "userguide" => "preset-mode", "options" => array("ON", "OFF"), "type" => "select"), array("type" => "open"), array("name" => "Ad Units", "type" => "title"), array("name" => "Adsense Unit 1", "desc" => "", "id" => $shortname . "_ad_unit_1", "slug" => $shortname . "-widget-ad-unit-1", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_ad_unit_1", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Adsense Unit 2", "desc" => "", "id" => $shortname . "_ad_unit_2", "slug" => $shortname . "-widget-ad-unit-2", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_ad_unit_2", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Adsense Unit 3", "desc" => "", "id" => $shortname . "_ad_unit_3", "slug" => $shortname . "-widget-ad-unit-3", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_ad_unit_3", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("type" => "close"), array("type" => "open"), array("name" => "Link Units", "type" => "title"), array("name" => "Adsense Link Unit 1", "desc" => "", "id" => $shortname . "_link_unit_1", "slug" => $shortname . "-widget-link-unit-1", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_link_unit_1", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Adsense Link Unit 2", "desc" => "", "id" => $shortname . "_link_unit_2", "slug" => $shortname . "-widget-link-unit-2", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_link_unit_2", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Adsense Link Unit 3", "desc" => "", "id" => $shortname . "_link_unit_3", "slug" => $shortname . "-widget-link-unit-3", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_link_unit_3", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("type" => "close"), array("type" => "open"), array("name" => "Addtional Ad Units", "type" => "title"), array("name" => "Addtional Ad Unit 1", "desc" => "", "id" => $shortname . "_additional_unit_1", "slug" => $shortname . "-widget-additional-unit-1", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_additional_unit_1", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Addtional Ad Unit 2", "desc" => "", "id" => $shortname . "_additional_unit_2", "slug" => $shortname . "-widget-additional-unit-2", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_additional_unit_2", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Addtional Ad Unit 3", "desc" => "", "id" => $shortname . "_additional_unit_3", "slug" => $shortname . "-widget-additional-unit-3", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_additional_unit_3", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Addtional Ad Unit 4", "desc" => "", "id" => $shortname . "_additional_unit_4", "slug" => $shortname . "-widget-additional-unit-4", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_additional_unit_4", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Addtional Ad Unit 5", "desc" => "", "id" => $shortname . "_additional_unit_5", "slug" => $shortname . "-widget-additional-unit-5", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_additional_unit_5", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("name" => "Addtional Ad Unit 6", "desc" => "", "id" => $shortname . "_additional_unit_6", "slug" => $shortname . "-widget-additional-unit-6", "widgetdesc" => "Ad Unit (HeatMap Theme v" . $baseversion . ")", "function" => $shortname . "_widget_additional_unit_6", "std" => "", "userguide" => "adsense-ad-and-link-units", "checkbox" => array("Home" => "", "Page" => "", "Post" => "", "Category" => "", "Search" => "", "Archive" => ""), "type" => "ad-combo"), array("type" => "close"), array("type" => "open"), array("name" => "Header Bar options", "type" => "title"), array("name" => "Logo URL", "desc" => "", "id" => $shortname . "_logo_url", "std" => "", "userguide" => "logo-url", "type" => "text"), array("name" => "Logo ALT text description", "desc" => "", "id" => $shortname . "_alt_text", "std" => "", "userguide" => "logo-alt", "type" => "text"), array("name" => "Hide Title and Tagline?", "desc" => "", "id" => $shortname . "_show_title_and_tagline", "std" => "checked", "userguide" => "title-and-tagline", "type" => "checkbox"), array("type" => "close"), array("type" => "open"), array("name" => "Home Page options", "type" => "title"), array("name" => "Featured Page ID", "desc" => "", "id" => $shortname . "_featured", "std" => "", "userguide" => "featured-page-id", "type" => "text"), array("type" => "close"), array("type" => "open"), array("name" => "Navigation Options", "type" => "title"), array("name" => "Navigation ID exclusion", "type" => "heading"), array("name" => "Page IDs to exclude", "desc" => "", "id" => $shortname . "_exclude_pages", "std" => "", "userguide" => "page-id-exclusion", "type" => "text"), array("name" => "Category IDs to exclude", "desc" => "", "id" => $shortname . "_exclude_categories", "std" => "", "userguide" => "category-id-exclusion", "type" => "text"), array("type" => "close"), array("type" => "open"), array("name" => "Home Page Meta Description and Keywords", "type" => "title"), array("name" => "Meta Description", "desc" => "", "id" => $shortname . "_meta_description", "std" => "", "userguide" => "meta-description", "type" => "textarea"), array("name" => "Meta Keywords", "desc" => "", "id" => $shortname . "_meta_keywords", "std" => "", "userguide" => "meta-keywords", "type" => "textarea"), array("type" => "close"), array("type" => "open"), array("name" => "<em>Google Feedburner</em><sup>TM</sup> RSS Subscription", "type" => "title"), array("name" => "FeedBurner ID", "desc" => "", "id" => $shortname . "_feedburner_id", "std" => "", "userguide" => "feedburner-subscription", "type" => "text"), array("name" => "FeedBurner Comments ID", "desc" => "", "id" => $shortname . "_feedburner_comments_id", "std" => "", "userguide" => "feedburner-subscription", "type" => "text"), array("type" => "close"), array("type" => "open"), array("name" => "<em>Google Analytics</em><sup>TM</sup>", "type" => "title"), array("name" => "Tracker Code", "desc" => "", "id" => $shortname . "_google_analytics", "std" => "", "userguide" => "google-analytics", "type" => "textarea"), array("type" => "close"), array("type" => "open"), array("name" => "<em>Google Custom Search</em><sup>TM</sup>", "type" => "title"), array("name" => "Search Code", "desc" => "", "id" => $shortname . "_google_search", "std" => "", "userguide" => "google-adsense-custom-search", "type" => "textarea"), array("name" => "Results Code", "desc" => "", "id" => $shortname . "_google_results", "std" => "", "userguide" => "google-adsense-custom-search", "type" => "textarea"), array("type" => "close"), array("type" => "open"), array("name" => "Additional Page Code", "type" => "title"), array("name" => "Head Scripts", "desc" => "", "id" => $shortname . "_head_scripts", "std" => "", "userguide" => "head-scripts", "type" => "textarea"), array("type" => "close"), array("type" => "open"), array("name" => "Footer Bar options", "type" => "title"), array("name" => "Footer Left", "desc" => "", "id" => $shortname . "_footer_left", "std" => "", "userguide" => "footer-bar", "type" => "textarea"), array("name" => "Footer Right", "desc" => "", "id" => $shortname . "_footer_right", "std" => "", "userguide" => "footer-bar", "type" => "textarea"), array("name" => "Subfooter Left", "desc" => "", "id" => $shortname . "_subfooter_left", "std" => "", "userguide" => "footer-bar", "type" => "textarea"), array("name" => "Subfooter Right", "desc" => "You can change this credit link to something else. If you decide to retain it we say thanks! :)", "id" => $shortname . "_subfooter_right", "std" => "WordPress Theme by <a href=\"http://heatmaptheme.com\">HeatMapTheme.com</a>", "userguide" => "footer-bar", "type" => "textarea"), array("type" => "close"), array("name" => "Activate Preset Mode", "desc" => "", "id" => $shortname . "_preset_mode_activated", "std" => "ON", "userguide" => "preset-mode", "options" => array("ON", "OFF"), "type" => "select")); /* Register Widgets -------------------------------------------------------------- */ if (function_exists('wp_register_sidebar_widget')) { foreach ($options as $value) { // Loop through the options array looking for ad widgets. switch ($value['type']) { // When the details of an ad widget is found then grab its name and description and register it. case "ad-combo": $this_option = get_option($value['id']); if ($this_option != "") { $this_name = get_option($value['id'] . '_name'); if ($this_name == "") { $this_name = $value['name']; } $widget_ops = array('description' => $value['widgetdesc']); wp_register_sidebar_widget($value['slug'], $this_name, $value['function'], $widget_ops); } } } // Now register a couple of custom HeatMap Theme widgets $widget_ops = array('description' => "FeedBurner Email Subscription (HeatMap Theme v" . $baseversion . ")"); wp_register_sidebar_widget($shortname . '-feedburner-subscription', 'FeedBurner', $shortname . '_widget_feedburner', $widget_ops); $widget_ops = array('description' => "Recent Posts PLUS Thumbnails (HeatMap Theme v" . $baseversion . ")"); wp_register_sidebar_widget($shortname . '-recent-posts-plus', 'Recent Posts PLUS', $shortname . '_widget_recent_posts_plus', $widget_ops); // .. and here comes the registration of the 'sidebars' into which all those lovely widgets will be placed register_sidebar(array('name' => '[Widebar] Top', 'before_widget' => '<!-- %2$s --><li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h4 class="widgettitle">', 'after_title' => '</h4>')); register_sidebar(array('name' => '[Widebar] Bottom', 'before_widget' => '<!-- %2$s --><li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h4 class="widgettitle">', 'after_title' => '</h4>')); register_sidebar(array('name' => '[Sidebar] Left', 'before_widget' => '<!-- %2$s --><li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h4 class="widgettitle">', 'after_title' => '</h4>')); register_sidebar(array('name' => '[Sidebar] Right', 'before_widget' => '<!-- %2$s --><li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h4 class="widgettitle">', 'after_title' => '</h4>')); register_sidebar(array('name' => '[Header] High', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); register_sidebar(array('name' => '[Header] Right', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); register_sidebar(array('name' => '[All Content] Above', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="all-content-above %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); register_sidebar(array('name' => '[All Content] Below', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="all-content-below %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); register_sidebar(array('name' => '[Content Item] Above', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="content-item-above %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); register_sidebar(array('name' => '[Content Item] Below', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="content-item-below %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); register_sidebar(array('name' => '[Content Item] Left', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="content-item-left %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); register_sidebar(array('name' => '[Content Item] Right', 'before_widget' => '<!-- %2$s --><div id="%1$s" class="content-item-right %2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); } }
function pdf24Plugin_registerWidget() { global $pdf24Plugin; $widgetId = 'Articles To PDF'; if (function_exists('wp_register_sidebar_widget')) { wp_register_sidebar_widget($widgetId, $widgetId, 'pdf24Plugin_widget'); include_once $pdf24Plugin['dir'] . '/inc/widgetControl.php'; wp_register_widget_control($widgetId, $widgetId, 'pdf24Plugin_widgetControl'); } else { register_sidebar_widget($widgetId, 'pdf24Plugin_widget'); include_once $pdf24Plugin['dir'] . '/inc/widgetControl.php'; register_widget_control($widgetId, 'pdf24Plugin_widgetControl'); } }