Changes between Initial Version and Version 1 of Ticket #42061, comment 26
- Timestamp:
- 10/18/2023 05:21:28 PM (19 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #42061, comment 26
initial v1 1 1 Reviving this ticket, as the lack of this function also prevents proper testing to discover bugs like that fixed in https://github.com/WordPress/wordpress-develop/pull/5514. 2 2 3 @TimothyBlynJacobs I wonder whether we should circleback here. I'm not sure we really need to go down the rewrite rules rabbit hole. What about simply having a function that applies a filter instead of being forced to check `defined( 'REST_REQUEST' ) && REST_REQUEST`? It would make code paths testable that were previously not testable. The filter could be used to set the value temporarily to `true` for preloaded REST requests (i.e. those where REST routes are called without actually triggering a REST request).3 @TimothyBlynJacobs I wonder whether we should take a step back here. I'm not sure we really need to go down the rewrite rules rabbit hole. What about simply having a function that applies a filter instead of being forced to check `defined( 'REST_REQUEST' ) && REST_REQUEST`? It would make code paths testable that were previously not testable. The filter could be used to set the value temporarily to `true` for preloaded REST requests (i.e. those where REST routes are called without actually triggering a REST request). 4 4 5 5 To some degree, that would achieve a different goal, and we could consider reflecting that in the function's and filter's name accordingly. But I think it's worth considering that approach, as it would be much simpler and would bring immediate benefits to testability of core.