]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/bookmark-template.php
WordPress 4.7.2-scripts
[autoinstalls/wordpress.git] / wp-includes / bookmark-template.php
index 54ad5c998d0528d7d52faa749d83f3800c08e56b..c6b7fd2b550e63220071d4555a5c1b49de789658 100644 (file)
@@ -195,7 +195,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
  *                                      $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(
@@ -214,6 +214,12 @@ function wp_list_bookmarks( $args = '' ) {
 
        $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'],
@@ -242,7 +248,7 @@ function wp_list_bookmarks( $args = '' ) {
                                $r['category_before']
                        );
                        /**
-                        * Filter the bookmarks category name.
+                        * Filters the bookmarks category name.
                         *
                         * @since 2.2.0
                         *
@@ -283,7 +289,7 @@ function wp_list_bookmarks( $args = '' ) {
        }
 
        /**
-        * Filter the bookmarks list before it is echoed or returned.
+        * Filters the bookmarks list before it is echoed or returned.
         *
         * @since 2.5.0
         *