Opened 15 years ago
Closed 15 years ago
#12739 closed enhancement (fixed)
Create remove_theme_support() function
Reported by: | nathanrice | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Themes | Keywords: | dev-feedback has-patch |
Focuses: | Cc: |
Description
It would be nice to have a remove_theme_support() function. Many times, as a theme author, I would like to turn certain theme features "on" by default, but give the user (via a child theme) the option to turn the feature off.
In these cases, it would be nice to have a remove_theme_support() function they could use to do just that.
Attachments (2)
Change History (9)
#3
follow-up:
↓ 4
@
15 years ago
- Keywords dev-feedback added; theme-support removed
- Resolution fixed deleted
- Status changed from closed to reopened
I hadn't had the chance to comment here yet, and am only doing so in passing at the moment.
We use add_theme_support() internally in very interesting ways, that way we can use current_theme_supports() later on. That includes current_theme_supports('widgets') and 'editor-style', when in reality, you're never calling add_theme_support('editor-style') or 'widgets'. Instead, we use add_theme_support internally, calling it for example when a sidebar is registered.
remove_theme_support('widgets') will stop current_theme_supports() from working, but will not remove widgets.
If we do this, I guess we should probably blacklist certain ones such as background, widgets, etc.
#4
in reply to:
↑ 3
@
15 years ago
Replying to nacin:
remove_theme_support('widgets') will stop current_theme_supports() from working, but will not remove widgets.
If we do this, I guess we should probably blacklist certain ones such as background, widgets, etc.
Blacklisting sounds good to me. Do we have a list of features that you guys want to blacklist?
@
15 years ago
Patch blacklists internal theme support registrations. Also, it handles unregistering of post thumbnail support by post type.
#5
@
15 years ago
- Keywords has-patch added
Okay, patch attached that does two things. One, it adds a blacklist, which is currently widgets, custom-background, custom-header, and editor-style.
Two, it allows removal of support at the per-post-type level for post-thumbnails.
There are some issues with it, unfortunately. Post types won't be created until init, but this would be run by after_setup_theme.
#6
@
15 years ago
There are solutions for this, mainly preventing them from mucking with deregistering post types from post-thumbnails, when post-thumbnails was not registered for specific post types initially. Too late for 3.0 for now. Implementing the blacklist.
Workaround:
remove_theme_support('post-thumbnails'); add_theme_support('post-thumbnails', array( $ptypes_you_want ) );
(In [13877]) add remove_theme_support(), props nathanrice, fixes #12739