Changeset 42343 for trunk/src/wp-includes/bookmark-template.php
- Timestamp:
- 11/30/2017 11:09:33 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/bookmark-template.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/bookmark-template.php
r42201 r42343 51 51 function _walk_bookmarks( $bookmarks, $args = '' ) { 52 52 $defaults = array( 53 'show_updated' => 0, 'show_description' => 0, 54 'show_images' => 1, 'show_name' => 0, 55 'before' => '<li>', 'after' => '</li>', 'between' => "\n", 56 'show_rating' => 0, 'link_before' => '', 'link_after' => '' 53 'show_updated' => 0, 54 'show_description' => 0, 55 'show_images' => 1, 56 'show_name' => 0, 57 'before' => '<li>', 58 'after' => '</li>', 59 'between' => "\n", 60 'show_rating' => 0, 61 'link_before' => '', 62 'link_after' => '', 57 63 ); 58 64 … … 73 79 $the_link = esc_url( $bookmark->link_url ); 74 80 } 75 $desc = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) );76 $name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );77 $title = $desc;81 $desc = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) ); 82 $name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) ); 83 $title = $desc; 78 84 79 85 if ( $r['show_updated'] ) { … … 81 87 $title .= ' ('; 82 88 $title .= sprintf( 83 __( 'Last updated: %s'),89 __( 'Last updated: %s' ), 84 90 date( 85 91 get_option( 'links_updated_date_format' ), … … 97 103 $rel = $bookmark->link_rel; 98 104 if ( '' != $rel ) { 99 $rel = ' rel="' . esc_attr( $rel) . '"';105 $rel = ' rel="' . esc_attr( $rel ) . '"'; 100 106 } 101 107 $target = $bookmark->link_target; … … 111 117 $output .= "<img src=\"$bookmark->link_image\" $alt $title />"; 112 118 } else { // If it's a relative path 113 $output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";119 $output .= '<img src="' . get_option( 'siteurl' ) . "$bookmark->link_image\" $alt $title />"; 114 120 } 115 121 if ( $r['show_name'] ) { … … 200 206 function wp_list_bookmarks( $args = '' ) { 201 207 $defaults = array( 202 'orderby' => 'name', 'order' => 'ASC', 203 'limit' => -1, 'category' => '', 'exclude_category' => '', 204 'category_name' => '', 'hide_invisible' => 1, 205 'show_updated' => 0, 'echo' => 1, 206 'categorize' => 1, 'title_li' => __('Bookmarks'), 207 'title_before' => '<h2>', 'title_after' => '</h2>', 208 'category_orderby' => 'name', 'category_order' => 'ASC', 209 'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">', 210 'category_after' => '</li>' 208 'orderby' => 'name', 209 'order' => 'ASC', 210 'limit' => -1, 211 'category' => '', 212 'exclude_category' => '', 213 'category_name' => '', 214 'hide_invisible' => 1, 215 'show_updated' => 0, 216 'echo' => 1, 217 'categorize' => 1, 218 'title_li' => __( 'Bookmarks' ), 219 'title_before' => '<h2>', 220 'title_after' => '</h2>', 221 'category_orderby' => 'name', 222 'category_order' => 'ASC', 223 'class' => 'linkcat', 224 'category_before' => '<li id="%id" class="%class">', 225 'category_after' => '</li>', 211 226 ); 212 227 … … 218 233 $r['class'] = explode( ' ', $r['class'] ); 219 234 } 220 $r['class'] = array_map( 'sanitize_html_class', $r['class'] );221 $r['class'] = trim( join( ' ', $r['class'] ) );235 $r['class'] = array_map( 'sanitize_html_class', $r['class'] ); 236 $r['class'] = trim( join( ' ', $r['class'] ) ); 222 237 223 238 if ( $r['categorize'] ) { 224 $cats = get_terms( 'link_category', array( 225 'name__like' => $r['category_name'], 226 'include' => $r['category'], 227 'exclude' => $r['exclude_category'], 228 'orderby' => $r['category_orderby'], 229 'order' => $r['category_order'], 230 'hierarchical' => 0 231 ) ); 239 $cats = get_terms( 240 'link_category', array( 241 'name__like' => $r['category_name'], 242 'include' => $r['category'], 243 'exclude' => $r['exclude_category'], 244 'orderby' => $r['category_orderby'], 245 'order' => $r['category_order'], 246 'hierarchical' => 0, 247 ) 248 ); 232 249 if ( empty( $cats ) ) { 233 250 $r['categorize'] = false; … … 238 255 // Split the bookmarks into ul's for each category 239 256 foreach ( (array) $cats as $cat ) { 240 $params = array_merge( $r, array( 'category' => $cat->term_id ) );257 $params = array_merge( $r, array( 'category' => $cat->term_id ) ); 241 258 $bookmarks = get_bookmarks( $params ); 242 259 if ( empty( $bookmarks ) ) { … … 273 290 $output .= str_replace( 274 291 array( '%id', '%class' ), 275 array( "linkcat-". $r['category'], $r['class'] ),292 array( 'linkcat-' . $r['category'], $r['class'] ), 276 293 $r['category_before'] 277 294 );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)