Make WordPress Core

Changeset 58705

Timestamp:
07/10/2024 09:23:38 PM (4 weeks ago)
Author:
hellofromTonya
Message:

REST API: Ensure string returned in WP_REST_Templates_Controller::get_wp_templates_author_text_field().

Adds a fail-safe to return an empty string should the switch ever fall through without returning.

Currently, WP_REST_Templates_Controller::get_wp_templates_author_text_field() is tightly coupled to WP_REST_Templates_Controller::get_wp_templates_original_source_field(). However, if the $original_source values change in either method, but not both, it is possible a void or null will be returned, rather than a string.

Follow-up to [57366].

Props antonvlasenko, hellofromTonya, debarghyabanerjee.
Fixes #61580.

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.