equal
deleted
inserted
replaced
40 * description, and image. |
40 * description, and image. |
41 * 'show_rating' - Default is 0 (integer). Whether to show the link rating. |
41 * 'show_rating' - Default is 0 (integer). Whether to show the link rating. |
42 * |
42 * |
43 * @since 2.1.0 |
43 * @since 2.1.0 |
44 * @access private |
44 * @access private |
45 * @usedby wp_list_bookmarks() |
|
46 * |
45 * |
47 * @param array $bookmarks List of bookmarks to traverse |
46 * @param array $bookmarks List of bookmarks to traverse |
48 * @param string|array $args Optional. Overwrite the defaults. |
47 * @param string|array $args Optional. Overwrite the defaults. |
49 * @return string Formatted output in HTML |
48 * @return string Formatted output in HTML |
50 */ |
49 */ |
77 $title = $desc; |
76 $title = $desc; |
78 |
77 |
79 if ( $show_updated ) |
78 if ( $show_updated ) |
80 if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) { |
79 if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) { |
81 $title .= ' ('; |
80 $title .= ' ('; |
82 $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600))); |
81 $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS))); |
83 $title .= ')'; |
82 $title .= ')'; |
84 } |
83 } |
85 |
84 |
86 $alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"'; |
85 $alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"'; |
87 |
86 |
187 * @see get_bookmarks() For other arguments that can be set in this function and |
186 * @see get_bookmarks() For other arguments that can be set in this function and |
188 * passed to get_bookmarks(). |
187 * passed to get_bookmarks(). |
189 * @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks |
188 * @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks |
190 * |
189 * |
191 * @since 2.1.0 |
190 * @since 2.1.0 |
192 * @uses _list_bookmarks() Used to iterate over all of the bookmarks and return |
191 * @uses _walk_bookmarks() Used to iterate over all of the bookmarks and return |
193 * the html |
192 * the html |
194 * @uses get_terms() Gets all of the categories that are for links. |
193 * @uses get_terms() Gets all of the categories that are for links. |
195 * |
194 * |
196 * @param string|array $args Optional. Overwrite the defaults of the function |
195 * @param string|array $args Optional. Overwrite the defaults of the function |
197 * @return string|null Will only return if echo option is set to not echo. |
196 * @return string|null Will only return if echo option is set to not echo. |
214 extract( $r, EXTR_SKIP ); |
213 extract( $r, EXTR_SKIP ); |
215 |
214 |
216 $output = ''; |
215 $output = ''; |
217 |
216 |
218 if ( $categorize ) { |
217 if ( $categorize ) { |
219 //Split the bookmarks into ul's for each category |
218 $cats = get_terms( 'link_category', array( 'name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0 ) ); |
220 $cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0)); |
219 if ( empty( $cats ) ) |
221 |
220 $categorize = false; |
|
221 } |
|
222 |
|
223 if ( $categorize ) { |
|
224 // Split the bookmarks into ul's for each category |
222 foreach ( (array) $cats as $cat ) { |
225 foreach ( (array) $cats as $cat ) { |
223 $params = array_merge($r, array('category'=>$cat->term_id)); |
226 $params = array_merge($r, array('category'=>$cat->term_id)); |
224 $bookmarks = get_bookmarks($params); |
227 $bookmarks = get_bookmarks($params); |
225 if ( empty($bookmarks) ) |
228 if ( empty($bookmarks) ) |
226 continue; |
229 continue; |