本文整理汇总了PHP中wp_register_sidebar_widget函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_register_sidebar_widget函数的具体用法?PHP wp_register_sidebar_widget怎么用?PHP wp_register_sidebar_widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_register_sidebar_widget函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: language_selector_widget_init
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');
}
开发者ID:envickery,项目名称:staging.xylemwatermark.org,代码行数:7,代码来源:language-switcher.php
示例2: init
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);
}
开发者ID:rodrigoprimo,项目名称:yogamitra,代码行数:32,代码来源:stray_widgets.php
示例3: __construct
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);
}
开发者ID:ugurbastan,项目名称:swe-574-group4,代码行数:29,代码来源:extra_search_fields.php
示例4: ss_menu_widget_init
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));
}
}
开发者ID:hewu,项目名称:blogwp,代码行数:25,代码来源:superslider-menu-widget.php
示例5: register_widget
/**
* 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));
}
}
开发者ID:alx,项目名称:SimplePress,代码行数:32,代码来源:media-rss-widget.php
示例6: widget_sidebar_init
/**
*
*/
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.'));
}
开发者ID:JanUrb,项目名称:Web-SystemeFL-WP,代码行数:10,代码来源:Menu_Widget.php
示例7: init
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'));
}
开发者ID:rodnover55,项目名称:last_tracks_shoutcast,代码行数:7,代码来源:last_track_widget.php
示例8: init
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}");
}
}
}
}
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:28,代码来源:Widget_Old.php
示例9: fadtastic_widget_init
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');
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:7,代码来源:functions.php
示例10: ocpwp_widget_generator_init
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');
}
开发者ID:AntonioSolanoTarroc,项目名称:opencart-product-in-wp,代码行数:7,代码来源:ocpwp_widgets.php
示例11: register_widget
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'];
}
开发者ID:juansalvatella,项目名称:dosnoventa,代码行数:7,代码来源:via-latest.php
示例12: register_widget
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'));
}
}
开发者ID:bangjojo,项目名称:wp,代码行数:7,代码来源:dash_widget.php
示例13: gfci_wall_multi_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));
}
}
开发者ID:gagelafleur,项目名称:thebluemuse,代码行数:26,代码来源:wallgadget.php
示例14: initAction
/**
* 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'));
}
开发者ID:Ashleyotero,项目名称:oldest-old,代码行数:13,代码来源:Widget.class.php
示例15: quentin_widgets_init
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');
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:8,代码来源:functions.php
示例16: registerWidget
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);
}
开发者ID:madHorse54,项目名称:all-in-one-video-pack.wordpress,代码行数:8,代码来源:AllInOneVideoWidgetPlugin.php
示例17: widgetInit
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'));
}
开发者ID:rizzle-bizzle,项目名称:ards,代码行数:9,代码来源:flexi-quote-rotator.php
示例18: initAction
/**
* 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'));
}
开发者ID:nidalhajaj,项目名称:tubepress,代码行数:14,代码来源:Widget.class.php
示例19: __construct
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'));
}
开发者ID:DrizzlyOwl,项目名称:better-anchor-links,代码行数:9,代码来源:auto-anchor-list.php
示例20: load_widgets
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);
}
}
}
开发者ID:Jintha,项目名称:cama,代码行数:9,代码来源:widget.php
注:本文中的wp_register_sidebar_widget函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论