Changeset 6481
- Timestamp:
- 12/24/2007 07:04:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/bookmark-template.php
r6436 r6481 1 1 <?php 2 2 /** 3 * Bookmark Template Functions for usage in Themes 4 * 5 * @package WordPress 6 * @subpackage Template 7 */ 8 9 /** 10 * _walk_bookmarks() - The formatted output of a list of bookmarks 11 * 12 * The $bookmarks array must contain bookmark objects and will be iterated over 13 * to retrieve the bookmark to be used in the output. 14 * 15 * The output is formatted as HTML with no way to change that format. However, what 16 * is between, before, and after can be changed. The link itself will be HTML. 17 * 18 * This function is used internally by wp_list_bookmarks() and should not be used by 19 * themes. 20 * 21 * The defaults for overwriting are: 22 * 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated. 23 * 'show_description' - Default is 0 (integer). Whether to show the description of the bookmark. 24 * 'show_images' - Default is 1 (integer). Whether to show link image if available. 25 * 'before' - Default is '<li>' (string). The html or text to prepend to each bookmarks. 26 * 'after' - Default is '</li>' (string). The html or text to append to each bookmarks. 27 * 'between' - Default is '\n' (string). The string for use in between the link, description, and image. 28 * 'show_rating' - Default is 0 (integer). Whether to show the link rating. 29 * 30 * @since 2.1 31 * @access private 32 * @usedby wp_list_bookmarks() 33 * 34 * @param array $bookmarks List of bookmarks to traverse 35 * @param string|array $args Optional. Overwrite the defaults. 36 * @return string Formatted output in HTML 37 */ 3 38 function _walk_bookmarks($bookmarks, $args = '' ) { 4 39 $defaults = array( … … 78 113 } 79 114 115 /** 116 * wp_list_bookmarks() - Retrieve or echo all of the bookmarks 117 * 118 * List of default arguments are as follows: 119 * 'orderby' - Default is 'name' (string). How to order the links by. String is based off of the bookmark scheme. 120 * 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either ascending or descending order. 121 * 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to display. 122 * 'category' - Default is empty string (string). Include the links in what category ID(s). 123 * 'category_name' - Default is empty string (string). Get links by category name. 124 * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide links marked as 'invisible'. 125 * 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated. 126 * 'echo' - Default is 1 (integer). Whether to echo (default) or return the formatted bookmarks. 127 * 'categorize' - Default is 1 (integer). Whether to show links listed by category (default) or show links in one column. 128 * 129 * These options define how the Category name will appear before the category links are displayed, if 'categorize' is 1. 130 * If 'categorize' is 0, then it will display for only the 'title_li' string and only if 'title_li' is not empty. 131 * 'title_li' - Default is 'Bookmarks' (translatable string). What to show before the links appear. 132 * 'title_before' - Default is '<h2>' (string). The HTML or text to show before the 'title_li' string. 133 * 'title_after' - Default is '</h2>' (string). The HTML or text to show after the 'title_li' string. 134 * 'class' - Default is 'linkcat' (string). The CSS class to use for the 'title_li'. 135 * 136 * 'category_before' - Default is '<li id="%id" class="%class">'. String must contain '%id' and '%class' to get 137 * the id of the category and the 'class' argument. These are used for formatting in themes. Argument will be displayed 138 * before the 'title_before' argument. 139 * 'category_after' - Default is '</li>' (string). The HTML or text that will appear after the list of links. 140 * 141 * These are only used if 'categorize' is set to 1 or true. 142 * 'category_orderby' - Default is 'name'. How to order the bookmark category based on term scheme. 143 * 'category_order' - Default is 'ASC'. Set the order by either ASC (ascending) or DESC (descending). 144 * 145 * @see _walk_bookmarks() For other arguments that can be set in this function and passed to _walk_bookmarks(). 146 * @see get_bookmarks() For other arguments that can be set in this function and passed to get_bookmarks(). 147 * 148 * @since 2.1 149 * @uses _list_bookmarks() Used to iterate over all of the bookmarks and return the html 150 * @uses get_terms() Gets all of the categories that are for links. 151 * 152 * @param string|array $args Optional. Overwrite the defaults of the function 153 * @return string|null Will only return if echo option is set to not echo. Default is not return anything. 154 */ 80 155 function wp_list_bookmarks($args = '') { 81 156 $defaults = array(
Note: See TracChangeset
for help on using the changeset viewer.