[ Index ]

PHP Cross Reference of Wordpress 2.7.1

title

Body

[close]

/wp-includes/ -> widgets.php (summary)

API for creating dynamic sidebar without hardcoding functionality into themes. Includes both internal WordPress routines and theme use routines. This functionality was found in a plugin before WordPress 2.2 release which included it in the core from that point on.

File Size: 2100 lines (70 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 1 file
 wp-includes/rss.php

Defines 53 functions

  register_sidebars()
  register_sidebar()
  unregister_sidebar()
  register_sidebar_widget()
  wp_register_sidebar_widget()
  wp_widget_description()
  unregister_sidebar_widget()
  wp_unregister_sidebar_widget()
  register_widget_control()
  wp_register_widget_control()
  unregister_widget_control()
  wp_unregister_widget_control()
  dynamic_sidebar()
  is_active_widget()
  is_dynamic_sidebar()
  wp_get_sidebars_widgets()
  wp_set_sidebars_widgets()
  wp_get_widget_defaults()
  wp_widget_pages()
  wp_widget_pages_control()
  wp_widget_links()
  wp_widget_search()
  wp_widget_archives()
  wp_widget_archives_control()
  wp_widget_meta()
  wp_widget_meta_control()
  wp_widget_calendar()
  wp_widget_calendar_control()
  wp_widget_text()
  wp_widget_text_control()
  wp_widget_text_register()
  wp_widget_categories()
  onCatChange()
  wp_widget_categories_control()
  wp_widget_categories_register()
  wp_widget_categories_upgrade()
  wp_widget_recent_entries()
  wp_flush_widget_recent_entries()
  wp_widget_recent_entries_control()
  wp_widget_recent_comments()
  wp_delete_recent_comments_cache()
  wp_widget_recent_comments_control()
  wp_widget_recent_comments_style()
  wp_widget_recent_comments_register()
  wp_widget_rss()
  wp_widget_rss_output()
  wp_widget_rss_control()
  wp_widget_rss_form()
  wp_widget_rss_process()
  wp_widget_rss_register()
  wp_widget_tag_cloud()
  wp_widget_tag_cloud_control()
  wp_widgets_init()

Functions
Functions that are not part of a class:

register_sidebars($number = 1, $args = array()   X-Ref
Creates multiple sidebars.

If you wanted to quickly create multiple sidebars for a theme or internally.
This function will allow you to do so. If you don't pass the 'name' and/or
'id' in $args, then they will be built for you.

The default for the name is "Sidebar #", with '#' being replaced with the
number the sidebar is currently when greater than one. If first sidebar, the
name will be just "Sidebar". The default for id is "sidebar-" followed by the
number the sidebar creation is currently at.

param: int $number Number of sidebars to create.
param: string|array $args Builds Sidebar based off of 'name' and 'id' values.

register_sidebar($args = array()   X-Ref
Builds the definition for a single sidebar and returns the ID.

The $args parameter takes either a string or an array with 'name' and 'id'
contained in either usage. It will be noted that the values will be applied
to all sidebars, so if creating more than one, it will be advised to allow
for WordPress to create the defaults for you.

Example for string would be <code>'name=whatever;id=whatever1'</code> and for
the array it would be <code>array(
'name' => 'whatever',
'id' => 'whatever1')</code>.

name - The name of the sidebar, which presumably the title which will be
displayed.
id - The unique identifier by which the sidebar will be called by.
before_widget - The content that will prepended to the widgets when they are
displayed.
after_widget - The content that will be appended to the widgets when they are
displayed.
before_title - The content that will be prepended to the title when displayed.
after_title - the content that will be appended to the title when displayed.

<em>Content</em> is assumed to be HTML and should be formatted as such, but
doesn't have to be.

param: string|array $args Builds Sidebar based off of 'name' and 'id' values
return: string The sidebar id that was added.

unregister_sidebar( $name )   X-Ref
Removes a sidebar from the list.

param: string $name The ID of the sidebar when it was added.

register_sidebar_widget($name, $output_callback, $classname = '')   X-Ref
Register widget for sidebar with backwards compatibility.

Allows $name to be an array that accepts either three elements to grab the
first element and the third for the name or just uses the first element of
the array for the name.

Passes to {@link wp_register_sidebar_widget()} after argument list and
backwards compatibility is complete.

param: string|int $name Widget ID.
param: callback $output_callback Run when widget is called.
param: string $classname Classname widget option.
param: mixed $params,... Widget parameters.

wp_register_sidebar_widget($id, $name, $output_callback, $options = array()   X-Ref
Register widget for use in sidebars.

The default widget option is 'classname' that can be override.

The function can also be used to unregister widgets when $output_callback
parameter is an empty string.

param: int|string $id Widget ID.
param: string $name Widget display title.
param: callback $output_callback Run when widget is called.
param: array|string Optional. $options Widget Options.
param: mixed $params,... Widget parameters to add to widget.
return: null Will return if $output_callback is empty after removing widget.

wp_widget_description( $id )   X-Ref
Retrieve description for widget.

When registering widgets, the options can also include 'description' that
describes the widget for display on the widget administration panel or
in the theme.

param: int|string $id Widget ID.
return: string Widget description, if available. Null on failure to retrieve description.

unregister_sidebar_widget($id)   X-Ref
Alias of {@link wp_unregister_sidebar_widget()}.

param: int|string $id Widget ID.

wp_unregister_sidebar_widget($id)   X-Ref
Remove widget from sidebar.

param: int|string $id Widget ID.

register_widget_control($name, $control_callback, $width = '', $height = '')   X-Ref
Registers widget control callback for customizing options.

Allows $name to be an array that accepts either three elements to grab the
first element and the third for the name or just uses the first element of
the array for the name.

Passes to {@link wp_register_widget_control()} after the argument list has
been compiled.

param: int|string $name Sidebar ID.
param: callback $control_callback Widget control callback to display and process form.
param: int $width Widget width.
param: int $height Widget height.

wp_register_widget_control($id, $name, $control_callback, $options = array()   X-Ref
Registers widget control callback for customizing options.

The options contains the 'height', 'width', and 'id_base' keys. The 'height'
option is never used. The 'width' option is the width of the fully expanded
control form, but try hard to use the default width. The 'id_base' is for
multi-widgets (widgets which allow multiple instances such as the text
widget), an id_base must be provided. The widget id will end up looking like
{$id_base}-{$unique_number}.

param: int|string $id Sidebar ID.
param: string $name Sidebar display name.
param: callback $control_callback Run when sidebar is displayed.
param: array|string $options Optional. Widget options. See above long description.
param: mixed $params,... Optional. Additional parameters to add to widget.

unregister_widget_control($id)   X-Ref
Alias of {@link wp_unregister_widget_control()}.

param: int|string $id Widget ID.

wp_unregister_widget_control($id)   X-Ref
Remove control callback for widget.

param: int|string $id Widget ID.

dynamic_sidebar($index = 1)   X-Ref
Display dynamic sidebar.

By default it displays the default sidebar or 'sidebar-1'. The 'sidebar-1' is
not named by the theme, the actual name is '1', but 'sidebar-' is added to
the registered sidebars for the name. If you named your sidebar 'after-post',
then the parameter $index will still be 'after-post', but the lookup will be
for 'sidebar-after-post'.

It is confusing for the $index parameter, but just know that it should just
work. When you register the sidebar in the theme, you will use the same name
for this function or "Pay no heed to the man behind the curtain." Just accept
it as an oddity of WordPress sidebar register and display.

param: int|string $index Optional, default is 1. Name or ID of dynamic sidebar.
return: bool True, if widget sidebar was found and called. False if not found or not called.

is_active_widget($callback, $widget_id = false)   X-Ref
Whether widget is registered using callback with widget ID.

Will only check if both parameters are used. Used to find which sidebar the
widget is located in, but requires that both the callback and the widget ID
be known.

param: callback $callback Widget callback to check.
param: int $widget_id Optional, but needed for checking. Widget ID.

is_dynamic_sidebar()   X-Ref
Whether the dynamic sidebar is enabled and used by theme.

return: bool True, if using widgets. False, if not using widgets.

wp_get_sidebars_widgets($update = true)   X-Ref
Retrieve full list of sidebars and their widgets.

Will upgrade sidebar widget list, if needed. Will also save updated list, if
needed.

param: bool $update Optional, default is true. Whether to save upgrade of widget array list.
return: array Upgraded list of widgets to version 2 array format.

wp_set_sidebars_widgets( $sidebars_widgets )   X-Ref
Set the sidebar widget option to update sidebars.

param: array $sidebars_widgets Sidebar widgets and their settings.

wp_get_widget_defaults()   X-Ref
Retrieve default registered sidebars list.

return: array

wp_widget_pages( $args )   X-Ref
Display pages widget.

param: array $args Widget arguments.

wp_widget_pages_control()   X-Ref
Display and process pages widget options form.


wp_widget_links($args)   X-Ref
Display links widget.

param: array $args Widget arguments.

wp_widget_search($args)   X-Ref
Display search widget.

param: array $args Widget arguments.

wp_widget_archives($args)   X-Ref
Display archives widget.

param: array $args Widget arguments.

wp_widget_archives_control()   X-Ref
Display and process archives widget options form.


wp_widget_meta($args)   X-Ref
Display meta widget.

Displays log in/out, RSS feed links, etc.

param: array $args Widget arguments.

wp_widget_meta_control()   X-Ref
Display and process meta widget options form.


wp_widget_calendar($args)   X-Ref
Display calendar widget.

param: array $args Widget arguments.

wp_widget_calendar_control()   X-Ref
Display and process calendar widget options form.


wp_widget_text($args, $widget_args = 1)   X-Ref
Display the Text widget, depending on the widget number.

Supports multiple text widgets and keeps track of the widget number by using
the $widget_args parameter. The option 'widget_text' is used to store the
content for the widgets. The content and title are passed through the
'widget_text' and 'widget_title' filters respectively.

param: array $args Widget arguments.
param: int $number Widget number.

wp_widget_text_control($widget_args)   X-Ref
Display and process text widget options form.

param: int $widget_args Widget number.

wp_widget_text_register()   X-Ref
Register text widget on startup.


wp_widget_categories($args, $widget_args = 1)   X-Ref
Display categories widget.

Allows multiple category widgets.

param: array $args Widget arguments.
param: int $number Widget number.

onCatChange()   X-Ref
No description

wp_widget_categories_control( $widget_args )   X-Ref
Display and process categories widget options form.

param: int $widget_args Widget number.

wp_widget_categories_register()   X-Ref
Register categories widget on startup.


wp_widget_categories_upgrade()   X-Ref
Upgrade previous category widget to current version.

return: array

wp_widget_recent_entries($args)   X-Ref
Display recent entries widget.

param: array $args Widget arguments.
return: int Displayed cache.

wp_flush_widget_recent_entries()   X-Ref
Remove recent entries widget items cache.


wp_widget_recent_entries_control()   X-Ref
Display and process recent entries widget options form.


wp_widget_recent_comments($args)   X-Ref
Display recent comments widget.

param: array $args Widget arguments.

wp_delete_recent_comments_cache()   X-Ref
Remove the cache for recent comments widget.


wp_widget_recent_comments_control()   X-Ref
Display and process recent comments widget options form.


wp_widget_recent_comments_style()   X-Ref
Display the style for recent comments widget.


wp_widget_recent_comments_register()   X-Ref
Register recent comments with control and hook for 'wp_head' action.


wp_widget_rss($args, $widget_args = 1)   X-Ref
Display RSS widget.

Allows for multiple widgets to be displayed.

param: array $args Widget arguments.
param: int $number Widget number.

wp_widget_rss_output( $rss, $args = array()   X-Ref
Display the RSS entries in a list.

param: string|array|object $rss RSS url.
param: array $args Widget arguments.

wp_widget_rss_control($widget_args)   X-Ref
Display and process RSS widget control form.

param: int $widget_args Widget number.

wp_widget_rss_form( $args, $inputs = null )   X-Ref
Display RSS widget options form.

The options for what fields are displayed for the RSS form are all booleans
and are as follows: 'url', 'title', 'items', 'show_summary', 'show_author',
'show_date'.

param: array|string $args Values for input fields.
param: array $inputs Override default display options.

wp_widget_rss_process( $widget_rss, $check_feed = true )   X-Ref
Process RSS feed widget data and optionally retrieve feed items.

The feed widget can not have more than 20 items or it will reset back to the
default, which is 10.

The resulting array has the feed title, feed url, feed link (from channel),
feed items, error (if any), and whether to show summary, author, and date.
All respectively in the order of the array elements.

param: array $widget_rss RSS widget feed data. Expects unescaped data.
param: bool $check_feed Optional, default is true. Whether to check feed for errors.
return: array

wp_widget_rss_register()   X-Ref
Register RSS widget to allow multiple RSS widgets on startup.


wp_widget_tag_cloud($args)   X-Ref
Display tag cloud widget.

param: array $args Widget arguments.

wp_widget_tag_cloud_control()   X-Ref
Manage WordPress Tag Cloud widget options.

Displays management form for changing the tag cloud widget title.


wp_widgets_init()   X-Ref
Register all of the default WordPress widgets on startup.

Calls 'widgets_init' action after all of the WordPress widgets have been
registered.




Generated: Mon Mar 23 16:23:02 2009 Cross-referenced by PHPXref 0.7