Permalink
Browse files

Implementing suggestions as described in issue #4.

  • Loading branch information...
1 parent f5d5a31 commit dd32f76d2c7f6acdb0e32b419bbfc77abd910302 @zamoose committed Oct 31, 2012
Showing with 24 additions and 3 deletions.
  1. +3 −2 tha-example-index.php
  2. +21 −1 tha-theme-hooks.php
@@ -1,4 +1,4 @@
-<html>
+<?php tha_html_before(); ?><html>
<head>
<?php tha_head_top(); ?>
<title><?php wp_title(); ?></title>
@@ -7,7 +7,7 @@
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
-
+<?php tha_body_top(); ?>
<?php tha_header_before(); ?>
<div id="header">
<?php tha_header_top(); ?>
@@ -69,5 +69,6 @@
</div><!-- #footer -->
<?php tha_footer_after(); ?>
<?php wp_footer(); ?>
+ <?php tha_body_bottom(); ?>
</body>
</html>
View
@@ -54,6 +54,7 @@
* When the 'all' parameter was set, specific hook types do not need to be
* added explicitly.
*/
+ 'body',
'head',
'header',
'content',
@@ -95,6 +96,26 @@ function tha_current_theme_supports( $bool, $args, $registered ) {
add_filter( 'current_theme_supports-tha_hooks', 'tha_current_theme_supports', 10, 3 );
/**
+ * HTML <html> hook
+ * Special case, useful for <DOCTYPE>, etc.
+ * $tha_supports[] = 'html;
+ */
+ 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_bottom() {
+ do_action( 'tha_body_bottom' );
+ }
+
+/**
* HTML <head> hooks
*
* $tha_supports[] = 'head';
@@ -107,7 +128,6 @@ function tha_head_bottom() {
do_action( 'tha_head_bottom' );
}
-
/**
* Semantic <header> hooks
*

0 comments on commit dd32f76

Please sign in to comment.