Opened 11 months ago
Closed 9 months ago
#21099 closed defect (bug) (fixed)
The 'allowed_themes' filter has disappeared
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4.2 |
| Component: | Themes | Version: | 3.4 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | scribu, lancewillett |
Description
r20029 deprecated the get_allowed_themes() function and replaced it with wp_get_themes( array( 'allowed' => true ) ). This also removed the allowed_themes filter.
- Is there a replacement filter?
- If not, can the allowed_themes filter be reinstated?
Attachments (3)
Change History (16)
comment:1
johnbillion — 11 months ago
- Milestone changed from Awaiting Review to 3.4.2
Yeah, this should be added back to WP_Theme. Seems like WP_Theme::get_allowed() would make the most sense, as there was no filter in wpmu_get_blog_allowedthemes() or get_site_allowed_themes().
SergeyBiryukov — 11 months ago
comment:3
SergeyBiryukov — 11 months ago
- Keywords has-patch added
comment:4
follow-up:
↓ 6
SergeyBiryukov — 11 months ago
In 3.3, only get_site_allowed_themes() part was filtered:
http://core.trac.wordpress.org/browser/tags/3.3.3/wp-admin/includes/theme.php#L149
The patch assumes that it would make sense to filter the whole returned array.
Replying to SergeyBiryukov:
The patch assumes that it would make sense to filter the whole returned array.
Not sure that's a good assumption. The filter only acts on a network-wide array, with no context for the blog_id being requested.
We should add in some new filters.
SergeyBiryukov — 10 months ago
comment:7
SergeyBiryukov — 10 months ago
21099.2.patch is another take.
allowed_themes should mirror the 3.3 behaviour. site_allowed_themes is a new filter, which passes $blog_id for context.
Wouldn't the 'site_allowed_themes' make more sense inside the get_allowed_on_site() method?
SergeyBiryukov — 10 months ago
comment:9
in reply to:
↑ 8
SergeyBiryukov — 10 months ago
Replying to scribu:
Wouldn't the 'site_allowed_themes' make more sense inside the get_allowed_on_site() method?
Indeed. Added network_allowed_themes as well for consistency.
comment:10
lancewillett — 10 months ago
- Cc lancewillett added
comment:11
nacin — 9 months ago
In [21686]:
comment:12
nacin — 9 months ago
In [21699]:
comment:13
nacin — 9 months ago
- Resolution set to fixed
- Status changed from new to closed

And just to add a little more context, the allowed_themes filter could previously be used to filter the themes shown on the Themes screen on sites within a network. This is no longer possible.