[wp-hackers] Add Theme support with specified post type

24/7 24-7 at gmx.net
Fri May 11 10:37:26 UTC 2012


I'm trying to hold my plugins and themes mostly options free, as this saves 
me a lot of time (no need for activate/deactivate/uninstall + testing) and 
helps my users living with a slim database.

So here's what I tried: `add_theme_support( 'plugin_name', array( 'post', 
'custom_post_type' ) );`. That allows me to check the global, show/hide 
stuff, etc.

And here's the problem: That "feature" is not (yet) implemented [1].

So here's my idea for a workaround: Check the `global $post_type` (if set) 
or `$pagenow, $typenow, $hook_suffix` or something from the `
current_screen_object()` against `$_wp_theme_features['plugin_name'][0]`.

Q: Anyone got a better idea than doing it via a global?

Thanks!
Kaiser.

[1] 
http://core.trac.wordpress.org/browser/branches/3.3/wp-includes/theme.php#L1941


More information about the wp-hackers mailing list