[wp-trac] [WordPress Trac] #36666: Enhance `remove_theme_support()` so that it can take additional arguments

WordPress Trac noreply at wordpress.org
Tue Apr 26 14:50:55 UTC 2016


#36666: Enhance `remove_theme_support()` so that it can take additional arguments
------------------------------------+------------------------------
 Reporter:  flixos90                |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Themes                  |     Version:  3.0
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+------------------------------

Comment (by flixos90):

 Replying to [comment:5 jmichaelward]:
 > > About the grouping, post formats and HTML5 can be together, but post
 thumbnails work a little differently (keep in mind that this feature might
 just have the value `true` in which case we can't remove anything from
 it).
 >
 > I looked through the documentation before putting this together, and as
 far as I could tell, the data structures for how HTML5, Post Formats, and
 Post Thumbnails are stored in the global `$_wp_theme_features` variable
 were the same. This would suggest to me that they could be removed in the
 same fashion. Am I mistaken?

 I meant that post thumbnail support is a little different from post
 formats and HTML5 support since you can do `add_theme_support( 'post-
 thumbnails' )` which will produce `$_wp_theme_features = true` - so
 there's a chance that this variable is not an array (which is not handled
 in your initial patch). However in this case, we need to think about what
 the result of something like `remove_theme_support( 'post-thumbnails',
 array( 'post' )` would be: my initial thought says we should return
 `false` in this case as it's simply not possible to remove a specific post
 type from support then.

 About the other issues, let's wait for some more feedback first.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36666#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list