Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f73d6bf818
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 196 lines (167 sloc) 4.035 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
<?php
/**
* Theme Hook Alliance hook stub list.
*
* @package themehookalliance
* @version 1.0-draft
* @since 1.0-draft
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
*
* 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 the version of THA support, in case that becomes useful down the road.
*/
define( 'THA_HOOKS_VERSION', '1.0-draft' );

/**
* Themes and Plugins can check for tha_hooks using current_theme_supports( 'tha_hooks', $hook ) to determine
* whether a theme declares itself to support this specific hook type.
*/
add_theme_support( 'tha_hooks', array(
'head',
'header',
'content',
'entry',
'comments',
'sidebars',
'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.
*/
// 'core'
) );

/**
* Determines, whether the specific hook type is actually supported.
*
* Usage:
* if ( current_theme_supports( 'tha_hooks', 'header' ) )
* add_action( 'tha_head_top', 'prefix_header_top' );
*
* @param bool $bool true
* @param array $args The hook type being checked
* @param array $registered All registered hook types
*
* @return bool
*/
function tha_current_theme_supports( $bool, $args, $registered ) {
return in_array( $args[0], $registered[0] );
}
add_filter( 'current_theme_supports-tha_hooks', 'tha_current_theme_supports', 10, 3 );

/**
* HTML <head> hooks
*
* $tha_supports[] = 'head';
*/
function tha_head_top() {
do_action( 'tha_head_top' );
}

function tha_head_bottom() {
do_action( 'tha_head_bottom' );
}


/**
* Semantic <header> hooks
*
* $tha_supports[] = 'header';
*/
function tha_header_before() {
do_action( 'tha_header_before' );
}

function tha_header_after() {
do_action( 'tha_header_after' );
}

function tha_header_top() {
do_action( 'tha_header_top' );
}

function tha_header_bottom() {
do_action( 'tha_header_bottom' );
}

/**
* Semantic <content> hooks
*
* $tha_supports[] = 'content';
*/
function tha_content_before() {
do_action( 'tha_content_before' );
}

function tha_content_after() {
do_action( 'tha_content_after' );
}

function tha_content_top() {
do_action( 'tha_content_top' );
}

function tha_content_bottom() {
do_action( 'tha_content_bottom' );
}

/**
* Semantic <entry> hooks
*
* $tha_supports[] = 'entry';
*/
function tha_entry_before() {
do_action( 'tha_entry_before' );
}

function tha_entry_after() {
do_action( 'tha_entry_after' );
}

function tha_entry_top() {
do_action( 'tha_entry_top' );
}

function tha_entry_bottom() {
do_action( 'tha_entry_bottom' );
}

/**
* Comments block hooks
*
* $tha_supports[] = 'comments';
*/
function tha_comments_before() {
do_action( 'tha_comments_before' );
}

function tha_comments_after() {
do_action( 'tha_comments_after' );
}

/**
* Semantic <sidebar> hooks
*
* $tha_supports[] = 'sidebar';
*/
function tha_sidebars_before() {
do_action( 'tha_sidebars_before' );
}

function tha_sidebars_after() {
do_action( 'tha_sidebars_after' );
}

function tha_sidebar_top() {
do_action( 'tha_sidebar_top' );
}

function tha_sidebar_bottom() {
do_action( 'tha_sidebar_bottom' );
}

/**
* Semantic <footer> hooks
*
* $tha_supports[] = 'footer';
*/
function tha_footer_before() {
do_action( 'tha_footer_before' );
}

function tha_footer_after() {
do_action( 'tha_footer_after' );
}

function tha_footer_top() {
do_action( 'tha_footer_top' );
}

function tha_footer_bottom() {
do_action( 'tha_footer_bottom' );
}
Something went wrong with that request. Please try again.