[wp-trac] [WordPress Trac] #56975: Replace the internal `WP_Theme_JSON_Resolver::theme_has_support()` with a public function
WordPress Trac
noreply at wordpress.org
Thu Jan 19 13:47:22 UTC 2023
#56975: Replace the internal `WP_Theme_JSON_Resolver::theme_has_support()` with a
public function
-------------------------------------------------+-------------------------
Reporter: oandregal | Owner:
| hellofromTonya
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.2
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: dev-feedback needs-testing-info | Focuses:
gutenberg-merge has-patch has-unit-tests | performance
-------------------------------------------------+-------------------------
Comment (by hellofromTonya):
Summarizing solution options:
**Option 1: Adding a `is_admin()` check as a wrapper:**
* Pros:
* Simple approach in this specific use case as it's also checking `!
WP_DEBUG`.
* Cons:
* Adds a function call.
* Adds another conditional.
* Could cause confusion later for why `is_admin()` is being used.
**Option 2: Stubbing the functions in `wp-admin/includes/noop.php`**
{{{#!php
function wp_cache_get() {
return false;
}
function wp_cache_set() { {
return false;
}
}}}
* Pros:
* More resilient.
* Less code.
* Less chance of breaking sites when forgetting to add `! is_admin()`
wrapper.
* Centralized solution.
* Cons:
* Unknown side effects?
Are there instances of `function_exists( 'wp_cache_get' )` or
`function_exists( 'wp_cache_set' )`?
* Core: No
* Gutenberg: No
* Plugins in the wp.org plugin repo? Yes
https://wpdirectory.net/search/01GQ539955T9K8X8RZ0XY3YDXH. Only Ezoic
plugin might be impacted. The others shouldn't be due to how their code is
using it.
* Themes in the wp.org theme repo? No
https://wpdirectory.net/search/01GQ53PX6X59ZP5M34VR33W4K5
Mitigation:
Outreach can be done to the impacted plugin author. A dev note published
to alert developers.
Other potential unknown side effects?
These could be discovered throughout the 6.2 cycle through reports from
users and developers.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56975#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list