Make WordPress Core

Ticket #59052: 59052.patch

File 59052.patch, 1.7 KB (added by vishalpadhariya, 6 months ago)
  • src/wp-includes/widgets.php

    diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php
    index 32d8a95e1b..0b76753a9d 100644
    a b function _register_widget_update_callback( $id_base, $update_callback, $options 
    634634 *                                  Default empty array.
    635635 * @param mixed      ...$params     Optional additional parameters to pass to the callback function when it's called.
    636636 */
    637 
    638637function _register_widget_form_callback( $id, $name, $form_callback, $options = array(), ...$params ) {
    639638        global $wp_registered_widget_controls;
    640639
    function wp_widget_rss_output( $rss, $args = array() ) { 
    16351634                        $title = __( 'Untitled' );
    16361635                }
    16371636
    1638                 $desc = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );
    1639                 $desc = esc_attr( wp_trim_words( $desc, 55, ' […]' ) );
    1640 
    16411637                $summary = '';
    1642                 if ( $show_summary ) {
    1643                         $summary = $desc;
    16441638
    1645                         // Change existing [...] to […].
    1646                         if ( str_ends_with( $summary, '[...]' ) ) {
    1647                                 $summary = substr( $summary, 0, -5 ) . '[…]';
    1648                         }
     1639                if ( ! is_null( $item->get_description() ) ) {
     1640
     1641                        $desc = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );
     1642                        $desc = esc_attr( wp_trim_words( $desc, 55, ' […]' ) );
    16491643
    1650                         $summary = '<div class="rssSummary">' . esc_html( $summary ) . '</div>';
     1644                        if ( $show_summary ) {
     1645                                $summary = $desc;
     1646
     1647                                // Change existing [...] to [&hellip;].
     1648                                if ( str_ends_with( $summary, '[...]' ) ) {
     1649                                        $summary = substr( $summary, 0, -5 ) . '[&hellip;]';
     1650                                }
     1651
     1652                                $summary = '<div class="rssSummary">' . esc_html( $summary ) . '</div>';
     1653                        }
    16511654                }
    16521655
    16531656                $date = '';