Complete theme support implementation #3

Merged
merged 2 commits into from Jul 9, 2012

Conversation

Projects
None yet
2 participants
@obenland
Contributor

obenland commented Jul 6, 2012

With the current setup, THA works like Post Formats, where every supported format has to be explicitly registered. Reason: Even if only one hook type is registered with add_theme_support( 'tha_hooks', array( 'head' ) ), current_theme_supports( 'tha_hooks' ) will return true.

This patch reflects that, also moves the core flag to the registration array and fixes current_theme_supports() return value, when a second parameter is specified.

@zamoose

This comment has been minimized.

Show comment Hide comment
@zamoose

zamoose Jul 6, 2012

Owner

I'm liking where you're headed with this one. I need to sit down and dedicate a bit of time to mulling it over.

Owner

zamoose commented Jul 6, 2012

I'm liking where you're headed with this one. I need to sit down and dedicate a bit of time to mulling it over.

@ghost ghost assigned zamoose Jul 6, 2012

@zamoose

This comment has been minimized.

Show comment Hide comment
@zamoose

zamoose Jul 8, 2012

Owner

Hmm. Does this still work if you specify add_theme_support( 'tha_hooks' ) and current_theme_supports( 'tha_hooks' )? I don't want to have to pass an array in every time -- I'd like the above-listed case to be all-encompassing.

Owner

zamoose commented Jul 8, 2012

Hmm. Does this still work if you specify add_theme_support( 'tha_hooks' ) and current_theme_supports( 'tha_hooks' )? I don't want to have to pass an array in every time -- I'd like the above-listed case to be all-encompassing.

@obenland

This comment has been minimized.

Show comment Hide comment
@obenland

obenland Jul 9, 2012

Contributor

Only if you do not want to separate support for certain hook types.

With the current core implementation of the API, custom Theme features with arguments have to work like post formats.

Contributor

obenland commented Jul 9, 2012

Only if you do not want to separate support for certain hook types.

With the current core implementation of the API, custom Theme features with arguments have to work like post formats.

@zamoose

This comment has been minimized.

Show comment Hide comment
@zamoose

zamoose Jul 9, 2012

Owner

Well crap.

Hmm, what about two add_theme_support()s? add_theme_support( 'tha_hooks-all') vs. add_theme_support( 'tha_hooks', $array )? Any advantage in that tack?

Owner

zamoose commented Jul 9, 2012

Well crap.

Hmm, what about two add_theme_support()s? add_theme_support( 'tha_hooks-all') vs. add_theme_support( 'tha_hooks', $array )? Any advantage in that tack?

@obenland

This comment has been minimized.

Show comment Hide comment
@obenland

obenland Jul 9, 2012

Contributor

What about adding an 'all' parameter like so: add_theme_support( 'tha_hooks', array( 'all' ) );

This could work until there is a core patch, introducing more filters...

Contributor

obenland commented Jul 9, 2012

What about adding an 'all' parameter like so: add_theme_support( 'tha_hooks', array( 'all' ) );

This could work until there is a core patch, introducing more filters...

@zamoose

This comment has been minimized.

Show comment Hide comment
@zamoose

zamoose Jul 9, 2012

Owner

I like that approach. I'll merge this pull request -- mind putting one in that adds "all" compat?

Owner

zamoose commented Jul 9, 2012

I like that approach. I'll merge this pull request -- mind putting one in that adds "all" compat?

zamoose added a commit that referenced this pull request Jul 9, 2012

Merge pull request #3 from obenland/theme-support
Complete theme support implementation

@zamoose zamoose merged commit c76a2b4 into zamoose:master Jul 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment