Changeset 28586 for trunk/src/wp-includes/default-widgets.php
- Timestamp:
- 05/27/2014 11:07:32 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-widgets.php
r28532 r28586 1035 1035 1036 1036 echo '<ul>'; 1037 foreach ( $rss->get_items( 0, $items) as $item ) {1037 foreach ( $rss->get_items( 0, $items ) as $item ) { 1038 1038 $link = $item->get_link(); 1039 while ( stristr($link, 'http') != $link ) 1040 $link = substr($link, 1); 1041 $link = esc_url(strip_tags($link)); 1042 $title = esc_attr(strip_tags($item->get_title())); 1043 if ( empty($title) ) 1044 $title = __('Untitled'); 1039 while ( stristr( $link, 'http' ) != $link ) { 1040 $link = substr( $link, 1 ); 1041 } 1042 $link = esc_url( strip_tags( $link ) ); 1043 1044 $title = esc_html( trim( strip_tags( $item->get_title() ) ) ); 1045 if ( empty( $title ) ) { 1046 $title = __( 'Untitled' ); 1047 } 1045 1048 1046 1049 $desc = @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ); 1047 $desc = esc_attr( strip_tags( $desc ) ); 1048 $desc = trim( str_replace( array( "\n", "\r" ), ' ', $desc ) ); 1049 $desc = wp_html_excerpt( $desc, 360 ); 1050 $desc = esc_attr( wp_trim_words( $desc, 55, ' […]' ) ); 1050 1051 1051 1052 $summary = ''; … … 1053 1054 $summary = $desc; 1054 1055 1055 // Append ellipsis.Change existing [...] to […].1056 // Change existing [...] to […]. 1056 1057 if ( '[...]' == substr( $summary, -5 ) ) { 1057 1058 $summary = substr( $summary, 0, -5 ) . '[…]'; 1058 } elseif ( '[…]' != substr( $summary, -10 ) && $desc !== $summary ) {1059 $summary .= ' […]';1060 1059 } 1061 1060
Note: See TracChangeset
for help on using the changeset viewer.