Skip to content

Commit

Permalink
Update documentation, more hooks, add GPLv2 to the actual code.
Browse files Browse the repository at this point in the history
  • Loading branch information
zamoose committed Jul 2, 2012
1 parent 3569176 commit 1c5f5a4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -8,10 +8,10 @@ Original idea [here](http://literalbarrage.org/blog/2012/06/29/wordpress-theme-h

## Conventions ##

* Hooks are generally of the form `tha_` + `[section of the theme]` + `_[placement within block]`
* Hooks should be of the form `tha_` + `[section of the theme]` + `_[placement within block]`
* 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()`
* 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()`
11 changes: 11 additions & 0 deletions tha-example-index.php
Expand Up @@ -17,5 +17,16 @@

<?php tha_content_bottom(); ?>
</div><!-- #content -->

<?php tha_sidebars_before(); ?>
<div id="sidebar">

</div><!-- #sidebar-->
<?php tha_sidebars_after(); ?>

<div id="footer">

</div><!-- #footer -->

</body>
</html>
13 changes: 13 additions & 0 deletions tha-theme-hooks.php
@@ -1,4 +1,17 @@
<?php
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

define( 'THA_HOOKS_SUPPORT', true );

function tha_head_top() {
do_action( 'tha_head_top' );
Expand Down

0 comments on commit 1c5f5a4

Please sign in to comment.