Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More changes.

  • Loading branch information...
commit 35691766cdb7b67d1047e35e28e8dd3faaf4c908 1 parent cfd7aab
@zamoose zamoose authored
Showing with 30 additions and 3 deletions.
  1. +15 −3 README.md
  2. +15 −0 tha-theme-hooks.php
View
18 README.md
@@ -1,5 +1,17 @@
-= Theme Hook Alliance =
+# Theme Hook Alliance #
-Let's all come together and agree on a nice standard set of theme hooks.
+## What? ##
+Let's all come together and agree on a nice standard set of WordPress theme hooks.
-Original idea here: http://literalbarrage.org/blog/2012/06/29/wordpress-theme-hook-alliance
+## Why? ##
+Original idea [here](http://literalbarrage.org/blog/2012/06/29/wordpress-theme-hook-alliance).
+
+## Conventions ##
+
+* Hooks are generally of the form `tha_` + `[section of the theme]` + `_[placement within block]`
+* Hooks should be suffixed based upon their placement within a block
+ * Hooks immediately *preceding* a block should use `_before`
+ * Hooks immediately *following* a block should use `_after`
+ * Hooks placed at the very *beginning* of a block should use `_top`
+ * Hooks placed at the very *end* of a block should use `_bottom`
+* Hooks should be named based upon the generally-accepted semantic name for the section of a theme they cover, e.g., `tha_content_*` should refer to the section/block of a theme containing the content (or "The Loop"), while `tha_sidebar_*` would refer to the sidebars generally called by `get_sidebar()`
View
15 tha-theme-hooks.php
@@ -8,3 +8,18 @@ function tha_head_bottom() {
do_action( 'tha_head_bottom' );
}
+function tha_header_before() {
+ do_action( 'tha_header_before' );
+}
+
+function tha_header_after() {
+ do_action( 'tha_header_after' );
+}
+
+function tha_content_top() {
+ do_action( 'tha_content_top' );
+}
+
+function tha_content_bottom() {
+ do_action( 'tha_content_bottom' );
+}
Please sign in to comment.
Something went wrong with that request. Please try again.