本文整理汇总了PHP中wp_register_widget_control函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_register_widget_control函数的具体用法?PHP wp_register_widget_control怎么用?PHP wp_register_widget_control使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_register_widget_control函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: 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
示例5: 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
示例6: __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
示例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: 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
示例10: 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
示例11: 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
示例12: 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
示例13: 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
示例14: bp_blogs_register_widgets
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');
}
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:10,代码来源:bp-blogs-widgets.php
示例15: bp_activity_register_widgets
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');
}
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:10,代码来源:bp-activity-widgets.php
示例16: jal_on_plugins_loaded
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);
}
}
开发者ID:sontv1003,项目名称:vtcacademy,代码行数:10,代码来源:widgetized.php
示例17: vcita_init
/**
* 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');
}
开发者ID:nick-feifan,项目名称:healthwisetreat,代码行数:14,代码来源:vcita-utility-functions.php
示例18: groups_register_widgets
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');
}
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:12,代码来源:bp-groups-widgets.php
示例19: bp_chat_register_widgets
/**
* 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');
}
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:18,代码来源:bp-chat-widgets.php
示例20: widget_expand_control
function widget_expand_control()
{
global $wp_registered_widgets, $wp_registered_widget_controls;
foreach ($wp_registered_widgets as $id => $widget) {
if (!isset($wp_registered_widget_controls[$id])) {
wp_register_widget_control($id, $widget['name'], array(&$this, 'widget_empty_control'));
}
$wp_registered_widget_controls[$id]['callback_wpc_redirect'] = $wp_registered_widget_controls[$id]['callback'];
$wp_registered_widget_controls[$id]['callback'] = array(&$this, 'widget_extra_control');
array_push($wp_registered_widget_controls[$id]['params'], $id);
}
}
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:12,代码来源:class.admin_common.php
注:本文中的wp_register_widget_control函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论