X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca..8a4706fdeb1ae30268e510df6ccf3c39b3028059:/wp-includes/bookmark-template.php diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index 7c5949cc..cb30b896 100644 --- a/wp-includes/bookmark-template.php +++ b/wp-includes/bookmark-template.php @@ -42,7 +42,6 @@ * * @since 2.1.0 * @access private - * @usedby wp_list_bookmarks() * * @param array $bookmarks List of bookmarks to traverse * @param string|array $args Optional. Overwrite the defaults. @@ -79,7 +78,7 @@ function _walk_bookmarks($bookmarks, $args = '' ) { if ( $show_updated ) if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) { $title .= ' ('; - $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600))); + $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS))); $title .= ')'; } @@ -189,7 +188,7 @@ function _walk_bookmarks($bookmarks, $args = '' ) { * @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks * * @since 2.1.0 - * @uses _list_bookmarks() Used to iterate over all of the bookmarks and return + * @uses _walk_bookmarks() Used to iterate over all of the bookmarks and return * the html * @uses get_terms() Gets all of the categories that are for links. * @@ -216,9 +215,13 @@ function wp_list_bookmarks($args = '') { $output = ''; if ( $categorize ) { - //Split the bookmarks into ul's for each category - $cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0)); + $cats = get_terms( 'link_category', array( 'name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0 ) ); + if ( empty( $cats ) ) + $categorize = false; + } + if ( $categorize ) { + // Split the bookmarks into ul's for each category foreach ( (array) $cats as $cat ) { $params = array_merge($r, array('category'=>$cat->term_id)); $bookmarks = get_bookmarks($params); @@ -252,5 +255,3 @@ function wp_list_bookmarks($args = '') { return $output; echo $output; } - -?>