Changeset 58079
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php
r57919 r58079 166 166 } while ( ! empty( $hierarchy ) && empty( $fallback_template->content ) ); 167 167 168 $response = $this->prepare_item_for_response( $fallback_template, $request ); 168 // To maintain original behavior, return an empty object rather than a 404 error when no template is found. 169 $response = $fallback_template ? $this->prepare_item_for_response( $fallback_template, $request ) : new stdClass(); 169 170 170 171 return rest_ensure_response( $response ); -
trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php
r57919 r58079 911 911 912 912 /** 913 914 915 916 917 918 919 920 921 922 923 924 925 913 926 * @ticket 57851 914 927 *
Note: See TracChangeset
for help on using the changeset viewer.