WordPress/wp-includes/rest-api
hellofromTonya 70c9c49f9b 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.
Built from https://develop.svn.wordpress.org/trunk@58705


git-svn-id: http://core.svn.wordpress.org/trunk@58107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-10 21:25:11 +00:00
..
endpoints REST API: Ensure string returned in WP_REST_Templates_Controller::get_wp_templates_author_text_field(). 2024-07-10 21:25:11 +00:00
fields REST API: Improve error handling in REST meta fields 2024-02-13 09:57:08 +00:00
search REST API: Remove a few unused variables in `foreach` loops. 2024-07-09 13:53:16 +00:00
class-wp-rest-request.php Code Modernization: Remove obsolete comments about older PHP versions. 2024-07-06 14:54:16 +00:00
class-wp-rest-response.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:51:14 +00:00
class-wp-rest-server.php REST API: Correct variable type in `WP_Rest_Server::serve_batch_request_v1()`. 2024-07-08 13:25:18 +00:00