Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions tha-theme-hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* GNU General Public License for more details.
*/

/**
* Define the version of THA support, in case that becomes useful down the road.
*/
/**
* Define the version of THA support, in case that becomes useful down the road.
*/
define( 'THA_HOOKS_VERSION', '1.0-draft' );

/**
Expand Down Expand Up @@ -65,7 +65,7 @@
'sidebar',
'footer',

/**
/**
* 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.
Expand Down Expand Up @@ -101,20 +101,22 @@ function tha_current_theme_supports( $bool, $args, $registered ) {
* Special case, useful for <DOCTYPE>, etc.
* $tha_supports[] = 'html;
*/
function tha_html_before() {
do_action( 'tha_html_before' );
}
function tha_html_before() {
do_action( 'tha_html_before' );
}
/**
* HTML <body> hooks
* $tha_supports[] = 'body';
*/
function tha_body_top() {
do_action( 'tha_body_top' );
}
function tha_body_top() {
do_action( 'tha_body_top' );
}

function tha_body_bottom() {
do_action( 'tha_body_bottom' );
}
function tha_body_bottom() {
if ( current_theme_supports( 'tha_hooks', 'body' ) && ! did_action( 'tha_body_bottom' ) )
do_action( 'tha_body_bottom' );
}
add_action( 'wp_footer', 'tha_body_bottom', 1 );

/**
* HTML <head> hooks
Expand All @@ -126,8 +128,10 @@ function tha_head_top() {
}

function tha_head_bottom() {
do_action( 'tha_head_bottom' );
if ( current_theme_supports( 'tha_hooks', 'body' ) && ! did_action( 'tha_head_bottom' ) )
do_action( 'tha_head_bottom' );
}
add_action( 'wp_head', 'tha_head_bottom', 1 );

/**
* Semantic <header> hooks
Expand Down