* or 0|false. Default 1|true.
* @type int|bool $show_name Whether to show link name if available. Accepts 1|true or
* 0|false. Default 0|false.
- * @type string $before The HTML or text to prepend to each bookmark. Default '<li>'.
- * @type string $after The HTML or text to append to each bookmark. Default '</li>'.
+ * @type string $before The HTML or text to prepend to each bookmark. Default `<li>`.
+ * @type string $after The HTML or text to append to each bookmark. Default `</li>`.
* @type string $link_before The HTML or text to prepend to each bookmark inside the anchor
* tags. Default empty.
* @type string $link_after The HTML or text to append to each bookmark inside the anchor
* $categorize is true. Accepts 'ASC' (ascending) or 'DESC' (descending).
* Default 'ASC'.
* }
- * @return string|null Will only return if echo option is set to not echo. Default is not return anything.
+ * @return string|void Will only return if echo option is set to not echo. Default is not return anything.
*/
function wp_list_bookmarks( $args = '' ) {
$defaults = array(
$output = '';
+ if ( ! is_array( $r['class'] ) ) {
+ $r['class'] = explode( ' ', $r['class'] );
+ }
+ $r['class'] = array_map( 'sanitize_html_class', $r['class'] );
+ $r['class'] = trim( join( ' ', $r['class'] ) );
+
if ( $r['categorize'] ) {
$cats = get_terms( 'link_category', array(
'name__like' => $r['category_name'],
$r['category_before']
);
/**
- * Filter the bookmarks category name.
+ * Filters the bookmarks category name.
*
* @since 2.2.0
*
}
/**
- * Filter the bookmarks list before it is echoed or returned.
+ * Filters the bookmarks list before it is echoed or returned.
*
* @since 2.5.0
*