Changeset 45667 for trunk/src/wp-includes/bookmark-template.php
- Timestamp:
- 07/25/2019 12:47:53 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/bookmark-template.php
r45424 r45667 63 63 ); 64 64 65 $ r= wp_parse_args( $args, $defaults );65 $parsed_args = wp_parse_args( $args, $defaults ); 66 66 67 67 $output = ''; // Blank string to start with. … … 71 71 $bookmark->recently_updated = false; 72 72 } 73 $output .= $ r['before'];74 if ( $ r['show_updated'] && $bookmark->recently_updated ) {73 $output .= $parsed_args['before']; 74 if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) { 75 75 $output .= '<em>'; 76 76 } … … 83 83 $title = $desc; 84 84 85 if ( $ r['show_updated'] ) {85 if ( $parsed_args['show_updated'] ) { 86 86 if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) { 87 87 $title .= ' ('; … … 96 96 } 97 97 } 98 $alt = ' alt="' . $name . ( $ r['show_description'] ? ' ' . $title : '' ) . '"';98 $alt = ' alt="' . $name . ( $parsed_args['show_description'] ? ' ' . $title : '' ) . '"'; 99 99 100 100 if ( '' != $title ) { … … 111 111 $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>'; 112 112 113 $output .= $ r['link_before'];114 115 if ( $bookmark->link_image != null && $ r['show_images'] ) {113 $output .= $parsed_args['link_before']; 114 115 if ( $bookmark->link_image != null && $parsed_args['show_images'] ) { 116 116 if ( strpos( $bookmark->link_image, 'http' ) === 0 ) { 117 117 $output .= "<img src=\"$bookmark->link_image\" $alt $title />"; … … 119 119 $output .= '<img src="' . get_option( 'siteurl' ) . "$bookmark->link_image\" $alt $title />"; 120 120 } 121 if ( $ r['show_name'] ) {121 if ( $parsed_args['show_name'] ) { 122 122 $output .= " $name"; 123 123 } … … 126 126 } 127 127 128 $output .= $ r['link_after'];128 $output .= $parsed_args['link_after']; 129 129 130 130 $output .= '</a>'; 131 131 132 if ( $ r['show_updated'] && $bookmark->recently_updated ) {132 if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) { 133 133 $output .= '</em>'; 134 134 } 135 135 136 if ( $ r['show_description'] && '' != $desc ) {137 $output .= $ r['between'] . $desc;138 } 139 140 if ( $ r['show_rating'] ) {141 $output .= $ r['between'] . sanitize_bookmark_field(136 if ( $parsed_args['show_description'] && '' != $desc ) { 137 $output .= $parsed_args['between'] . $desc; 138 } 139 140 if ( $parsed_args['show_rating'] ) { 141 $output .= $parsed_args['between'] . sanitize_bookmark_field( 142 142 'link_rating', 143 143 $bookmark->link_rating, … … 146 146 ); 147 147 } 148 $output .= $ r['after'] . "\n";148 $output .= $parsed_args['after'] . "\n"; 149 149 } // end while 150 150 … … 226 226 ); 227 227 228 $ r= wp_parse_args( $args, $defaults );228 $parsed_args = wp_parse_args( $args, $defaults ); 229 229 230 230 $output = ''; 231 231 232 if ( ! is_array( $ r['class'] ) ) {233 $ r['class'] = explode( ' ', $r['class'] );232 if ( ! is_array( $parsed_args['class'] ) ) { 233 $parsed_args['class'] = explode( ' ', $parsed_args['class'] ); 234 234 } 235 $ r['class'] = array_map( 'sanitize_html_class', $r['class'] );236 $ r['class'] = trim( join( ' ', $r['class'] ) );237 238 if ( $ r['categorize'] ) {235 $parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] ); 236 $parsed_args['class'] = trim( join( ' ', $parsed_args['class'] ) ); 237 238 if ( $parsed_args['categorize'] ) { 239 239 $cats = get_terms( 240 240 'link_category', 241 241 array( 242 'name__like' => $ r['category_name'],243 'include' => $ r['category'],244 'exclude' => $ r['exclude_category'],245 'orderby' => $ r['category_orderby'],246 'order' => $ r['category_order'],242 'name__like' => $parsed_args['category_name'], 243 'include' => $parsed_args['category'], 244 'exclude' => $parsed_args['exclude_category'], 245 'orderby' => $parsed_args['category_orderby'], 246 'order' => $parsed_args['category_order'], 247 247 'hierarchical' => 0, 248 248 ) 249 249 ); 250 250 if ( empty( $cats ) ) { 251 $ r['categorize'] = false;251 $parsed_args['categorize'] = false; 252 252 } 253 253 } 254 254 255 if ( $ r['categorize'] ) {255 if ( $parsed_args['categorize'] ) { 256 256 // Split the bookmarks into ul's for each category 257 257 foreach ( (array) $cats as $cat ) { 258 $params = array_merge( $ r, array( 'category' => $cat->term_id ) );258 $params = array_merge( $parsed_args, array( 'category' => $cat->term_id ) ); 259 259 $bookmarks = get_bookmarks( $params ); 260 260 if ( empty( $bookmarks ) ) { … … 263 263 $output .= str_replace( 264 264 array( '%id', '%class' ), 265 array( "linkcat-$cat->term_id", $ r['class'] ),266 $ r['category_before']265 array( "linkcat-$cat->term_id", $parsed_args['class'] ), 266 $parsed_args['category_before'] 267 267 ); 268 268 /** … … 275 275 $catname = apply_filters( 'link_category', $cat->name ); 276 276 277 $output .= $ r['title_before'];277 $output .= $parsed_args['title_before']; 278 278 $output .= $catname; 279 $output .= $ r['title_after'];279 $output .= $parsed_args['title_after']; 280 280 $output .= "\n\t<ul class='xoxo blogroll'>\n"; 281 $output .= _walk_bookmarks( $bookmarks, $ r);281 $output .= _walk_bookmarks( $bookmarks, $parsed_args ); 282 282 $output .= "\n\t</ul>\n"; 283 $output .= $ r['category_after'] . "\n";283 $output .= $parsed_args['category_after'] . "\n"; 284 284 } 285 285 } else { 286 286 //output one single list using title_li for the title 287 $bookmarks = get_bookmarks( $ r);287 $bookmarks = get_bookmarks( $parsed_args ); 288 288 289 289 if ( ! empty( $bookmarks ) ) { 290 if ( ! empty( $ r['title_li'] ) ) {290 if ( ! empty( $parsed_args['title_li'] ) ) { 291 291 $output .= str_replace( 292 292 array( '%id', '%class' ), 293 array( 'linkcat-' . $ r['category'], $r['class'] ),294 $ r['category_before']293 array( 'linkcat-' . $parsed_args['category'], $parsed_args['class'] ), 294 $parsed_args['category_before'] 295 295 ); 296 $output .= $ r['title_before'];297 $output .= $ r['title_li'];298 $output .= $ r['title_after'];296 $output .= $parsed_args['title_before']; 297 $output .= $parsed_args['title_li']; 298 $output .= $parsed_args['title_after']; 299 299 $output .= "\n\t<ul class='xoxo blogroll'>\n"; 300 $output .= _walk_bookmarks( $bookmarks, $ r);300 $output .= _walk_bookmarks( $bookmarks, $parsed_args ); 301 301 $output .= "\n\t</ul>\n"; 302 $output .= $ r['category_after'] . "\n";302 $output .= $parsed_args['category_after'] . "\n"; 303 303 } else { 304 $output .= _walk_bookmarks( $bookmarks, $ r);304 $output .= _walk_bookmarks( $bookmarks, $parsed_args ); 305 305 } 306 306 } … … 316 316 $html = apply_filters( 'wp_list_bookmarks', $output ); 317 317 318 if ( ! $ r['echo'] ) {318 if ( ! $parsed_args['echo'] ) { 319 319 return $html; 320 320 }
Note: See TracChangeset
for help on using the changeset viewer.