Changeset 23196
- Timestamp:
- 12/23/2012 04:18:16 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/widgets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/widgets.php
r22118 r23196 510 510 * Builds the definition for a single sidebar and returns the ID. 511 511 * 512 * The $args parameter takes either a string or an array with 'name' and 'id' 513 * contained in either usage. It will be noted that the values will be applied 514 * to all sidebars, so if creating more than one, it will be advised to allow 515 * for WordPress to create the defaults for you. 516 * 517 * Example for string would be <code>'name=whatever;id=whatever1'</code> and for 518 * the array it would be <code>array( 519 * 'name' => 'whatever', 520 * 'id' => 'whatever1')</code>. 521 * 522 * name - The name of the sidebar, which presumably the title which will be 523 * displayed. 524 * id - The unique identifier by which the sidebar will be called by. 525 * before_widget - The content that will prepended to the widgets when they are 526 * displayed. 527 * after_widget - The content that will be appended to the widgets when they are 528 * displayed. 529 * before_title - The content that will be prepended to the title when displayed. 530 * after_title - the content that will be appended to the title when displayed. 531 * 532 * <em>Content</em> is assumed to be HTML and should be formatted as such, but 533 * doesn't have to be. 512 * Accepts either a string or an array and then parses that against a set 513 * of default arguments for the new sidebar. WordPress will automatically 514 * generate a sidebar ID and name based on the current number of registered 515 * sidebars if those arguments are not included. 516 * 517 * When allowing for automatic generation of the name and ID parameters, keep 518 * in mind that the incrementor for your sidebar can change over time depending 519 * on what other plugins and themes are installed. 520 * 521 * If theme support for 'widgets' has not yet been added when this function is 522 * called, it will be automatically enabled through the use of add_theme_support() 523 * 524 * Arguments passed as a string should be separated by '&' 525 * 526 * e.g. 'name=Sidebar&id=my_prefix_sidebar' 527 * 528 * The same argument passed as an array: 529 * 530 * array( 531 * 'name' => 'Sidebar', 532 * 'id' => 'my_prefix_sidebar', 533 * ) 534 * 535 * Arguments: 536 * name - The name or title of the sidebar displayed in the admin dashboard. 537 * id - The unique identifier by which the sidebar will be called. 538 * before_widget - HTML content that will be prepended to each widget's HTML output 539 * when assigned to this sidebar. 540 * after_widget - HTML content that will be appended to each widget's HTML output 541 * when assigned to this sidebar. 542 * before_title - HTML content that will be prepended to the sidebar title when displayed. 543 * after_title - HTML content that will be appended to the sidebar title when displayed. 534 544 * 535 545 * @since 2.2.0 536 546 * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID. 537 * 538 * @param string|array $args Builds Sidebar based off of 'name' and 'id' values 539 * @return string The sidebar id that was added. 547 * @uses add_theme_support() to ensure widget support has been added. 548 * 549 * @param string|array $args Arguments for the sidebar being registered. 550 * @return string Sidebar ID added to $wp_registered_sidebars global. 540 551 */ 541 552 function register_sidebar($args = array()) {
Note: See TracChangeset
for help on using the changeset viewer.