Don't append ellipsis in RSS widget if the entire content is shown. props kovshenin. fixes #21702.
git-svn-id: http://core.svn.wordpress.org/trunk@24213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
08bef7a3cb
commit
633a6fb400
|
@ -866,18 +866,18 @@ function wp_widget_rss_output( $rss, $args = array() ) {
|
||||||
$title = __('Untitled');
|
$title = __('Untitled');
|
||||||
|
|
||||||
$desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
$desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
|
||||||
$desc = wp_html_excerpt( $desc, 360 );
|
$excerpt = wp_html_excerpt( $desc, 360 );
|
||||||
|
|
||||||
// Append ellipsis. Change existing [...] to […].
|
// Append ellipsis. Change existing [...] to […].
|
||||||
if ( '[...]' == substr( $desc, -5 ) )
|
if ( '[...]' == substr( $excerpt, -5 ) )
|
||||||
$desc = substr( $desc, 0, -5 ) . '[…]';
|
$excerpt = substr( $excerpt, 0, -5 ) . '[…]';
|
||||||
elseif ( '[…]' != substr( $desc, -10 ) )
|
elseif ( '[…]' != substr( $excerpt, -10 ) && $desc != $excerpt )
|
||||||
$desc .= ' […]';
|
$excerpt .= ' […]';
|
||||||
|
|
||||||
$desc = esc_html( $desc );
|
$excerpt = esc_html( $excerpt );
|
||||||
|
|
||||||
if ( $show_summary ) {
|
if ( $show_summary ) {
|
||||||
$summary = "<div class='rssSummary'>$desc</div>";
|
$summary = "<div class='rssSummary'>$excerpt</div>";
|
||||||
} else {
|
} else {
|
||||||
$summary = '';
|
$summary = '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue