Commit 93ba50a1 authored by Sergey Biryukov's avatar Sergey Biryukov
Browse files

Formatting: Make the check for empty text in `wp_trim_excerpt()` more resilient.

This addresses a regression in [47808], which caused excerpts to be generated from post content if an empty string is passed, but not for other values considered empty, e.g. `null` or `false`.

Props riaanlom, laxman-prajapati, SergeyBiryukov.
Merges [48817] to the 5.5 branch.
Fixes #51042.
Built from https://develop.svn.wordpress.org/branches/5.5@48819


git-svn-id: https://core.svn.wordpress.org/branches/5.5@48581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 3d2fbc52
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3808,7 +3808,7 @@ function human_time_diff( $from, $to = 0 ) {
function wp_trim_excerpt( $text = '', $post = null ) {
	$raw_excerpt = $text;

	if ( '' === $text ) {
	if ( '' === trim( $text ) ) {
		$post = get_post( $post );
		$text = get_the_content( '', false, $post );

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 *
 * @global string $wp_version
 */
$wp_version = '5.5.1-alpha-48815';
$wp_version = '5.5.1-alpha-48819';

/**
 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.