* // Declare support for all hook types
* add_theme_support( 'tha_hooks', array( 'all' ) );
*
* // Declare support for certain hook types only
* add_theme_support( 'tha_hooks', array( 'header', 'content', 'footer' ) );
*
*/
add_theme_support( 'tha_hooks', array( 'all' ) );
/**
* Determines, whether the specific hook type is actually supported.
*
* Plugin developers should always check for the support of a specific
* hook type before hooking a callback function to a hook of this type.
*
* Example:
*
* 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] ) || in_array( 'all', $registered[0] );
} // /tha_current_theme_supports
add_filter( 'current_theme_supports-tha_hooks', 'tha_current_theme_supports', 10, 3 );