Commit d0499a9efa for wordpress.org

commit d0499a9efa7a3a99058989709c0c555e4d20043d
Author: SergeyBiryukov <sergeybiryukov@git.wordpress.org>
Date:   Sun Sep 20 14:36:53 2026 +0000

    Widgets: Avoid repeated `get_option()` calls in `wp_widget_rss_output()`.

    The `get_option( 'blog_charset' )` and `get_option( 'date_format' )` values are constant for the duration of the call. Resolving them once before the loop leaves the emitted markup byte-for-byte identical while avoiding the overhead of extra function calls and filter applications.

    Developed in https://github.com/WordPress/wordpress-develop/pull/13594.

    Follow-up to r6705, r10688, r63757, r63761.

    Props mukesh27, westonruter.
    Fixes #66132.
    Built from https://develop.svn.wordpress.org/trunk@63764


    git-svn-id: http://core.svn.wordpress.org/trunk@62936 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/version.php b/wp-includes/version.php
index e5f458d087..86d11633f6 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-alpha-63763';
+$wp_version = '7.2-alpha-63764';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php
index 2acfdd8c07..c88727e812 100644
--- a/wp-includes/widgets.php
+++ b/wp-includes/widgets.php
@@ -1637,6 +1637,9 @@ function wp_widget_rss_output( $rss, $args = array() ) {
 		return;
 	}

+	$blog_charset = get_option( 'blog_charset' );
+	$date_format  = $show_date ? get_option( 'date_format' ) : '';
+
 	echo '<ul>';
 	foreach ( $rss->get_items( 0, $items ) as $item ) {
 		$link = $item->get_link();
@@ -1650,7 +1653,7 @@ function wp_widget_rss_output( $rss, $args = array() ) {
 			$title = __( 'Untitled' );
 		}

-		$desc = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );
+		$desc = html_entity_decode( $item->get_description(), ENT_QUOTES, $blog_charset );
 		$desc = esc_attr( wp_trim_words( $desc, 55, ' [&hellip;]' ) );

 		$summary = '';
@@ -1670,7 +1673,7 @@ function wp_widget_rss_output( $rss, $args = array() ) {
 			$date = $item->get_date( 'U' );

 			if ( $date ) {
-				$date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>';
+				$date = ' <span class="rss-date">' . date_i18n( $date_format, $date ) . '</span>';
 			}
 		}