Permalink
Browse files

Move from define() constants to add_theme_support() for more flexibil…

…ity.
  • Loading branch information...
1 parent 233e1e8 commit 4a223cb386e5dc0ae337ce3199006dd0df1e5e14 @zamoose committed Jul 6, 2012
Showing with 24 additions and 3 deletions.
  1. +24 −3 tha-theme-hooks.php
View
@@ -19,10 +19,15 @@
*/
/**
- * Themes and plugins can check for THA_HOOKS_SUPPORT to determine whether a theme
- * declares itself to support THA hooks.
+ * Themes and plugins can check for tha_hooks using current_theme_supports( 'tha_hooks' ) to determine
+ * whether a theme declares itself to support THA hooks.
+ *
+ * We can further break down support by semantic type using an array as the second parameter.
+ * E.g., add_theme_support( 'tha_hooks', $tha_supports ). Check below for nomenclature.
+ *
+ * No second parameter == supports ALL THA hooks.
*/
-define( 'THA_HOOKS_SUPPORT', true );
+add_theme_support( 'tha_hooks' );
/**
* Define the version of THA support, in case that becomes useful down the road.
*/
@@ -31,11 +36,15 @@
* If/when WordPress Core implements similar methodology, themes and plugins will be
* able to check whether the version of THA supplied by the theme supports Core
* hooks.
+ *
+ * $tha_supports[] = 'core';
*/
define( 'THA_CORE_SUPPORT', false );
/**
* HTML <head> hooks
+*
+* $tha_supports[] = 'head';
*/
function tha_head_top() {
do_action( 'tha_head_top' );
@@ -48,6 +57,8 @@ function tha_head_bottom() {
/**
* Semantic <header> hooks
+*
+* $tha_supports[] = 'header';
*/
function tha_header_before() {
do_action( 'tha_header_before' );
@@ -67,6 +78,8 @@ function tha_header_bottom() {
/**
* Semantic <content> hooks
+*
+* $tha_supports[] = 'content';
*/
function tha_content_before() {
do_action( 'tha_content_before' );
@@ -86,6 +99,8 @@ function tha_content_bottom() {
/**
* Semantic <entry> hooks
+*
+* $tha_supports[] = 'entry';
*/
function tha_entry_before() {
do_action( 'tha_entry_before' );
@@ -105,6 +120,8 @@ function tha_entry_bottom() {
/**
* Comments block hooks
+*
+* $tha_supports[] = 'comments';
*/
function tha_comments_before() {
do_action( 'tha_comments_before' );
@@ -116,6 +133,8 @@ function tha_comments_after() {
/**
* Semantic <sidebar> hooks
+*
+* $tha_supports[] = 'sidebar';
*/
function tha_sidebars_before() {
do_action( 'tha_sidebars_before' );
@@ -135,6 +154,8 @@ function tha_sidebar_bottom() {
/**
* Semantic <footer> hooks
+*
+* $tha_supports[] = 'footer';
*/
function tha_footer_before() {
do_action( 'tha_footer_before' );

1 comment on commit 4a223cb

Owner

zamoose commented on 4a223cb Jul 6, 2012

Closes issue #1.

Please sign in to comment.