* // 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 ); /** * WebMan Theme Hooks */ /** * $tha_supports[] = 'html'; */ /** * HTML hook * Special case, useful for , etc. */ function wmhook_html_before() { do_action( 'wmhook_html_before' ); do_action( 'tha_html_before' ); } // /wmhook_html_before /** * $tha_supports[] = 'body'; */ /** * HTML hooks */ function wmhook_body_top() { do_action( 'wmhook_body_top' ); do_action( 'tha_body_top' ); } // /wmhook_body_top function wmhook_body_bottom() { do_action( 'wmhook_body_bottom' ); do_action( 'tha_body_bottom' ); } // /wmhook_body_bottom /** * $tha_supports[] = 'head'; */ /** * HTML hooks */ function wmhook_head_top() { do_action( 'wmhook_head_top' ); do_action( 'tha_head_top' ); } // /wmhook_head_top function wmhook_head_bottom() { do_action( 'wmhook_head_bottom' ); do_action( 'tha_head_bottom' ); } // /wmhook_head_bottom /** * $tha_supports[] = 'header'; */ /** * Semantic
hooks */ function wmhook_header_before() { do_action( 'wmhook_header_before' ); do_action( 'tha_header_before' ); } // /wmhook_header_before function wmhook_header_after() { do_action( 'wmhook_header_after' ); do_action( 'tha_header_after' ); } // /wmhook_header_after function wmhook_header() { do_action( 'wmhook_header' ); } // /wmhook_header function wmhook_header_top() { do_action( 'wmhook_header_top' ); do_action( 'tha_header_top' ); } // /wmhook_header_top function wmhook_header_bottom() { do_action( 'wmhook_header_bottom' ); do_action( 'tha_header_bottom' ); } // /wmhook_header_bottom /** * $tha_supports[] = 'content'; */ /** * Semantic hooks */ function wmhook_content_before() { do_action( 'wmhook_content_before' ); do_action( 'tha_content_before' ); } // /wmhook_content_before function wmhook_content_after() { do_action( 'wmhook_content_after' ); do_action( 'tha_content_after' ); } // /wmhook_content_after function wmhook_content_top() { do_action( 'wmhook_content_top' ); do_action( 'tha_content_top' ); } // /wmhook_content_top function wmhook_content_bottom() { do_action( 'wmhook_content_bottom' ); do_action( 'tha_content_bottom' ); } // /wmhook_content_bottom function wmhook_postslist_before() { do_action( 'wmhook_postslist_before' ); } // /wmhook_postslist_before function wmhook_postslist_after() { do_action( 'wmhook_postslist_after' ); } // /wmhook_postslist_after function wmhook_postslist_top() { do_action( 'wmhook_postslist_top' ); } // /wmhook_postslist_top function wmhook_postslist_bottom() { do_action( 'wmhook_postslist_bottom' ); } // /wmhook_postslist_bottom /** * $tha_supports[] = 'entry'; */ /** * Semantic hooks */ function wmhook_entry_before() { do_action( 'wmhook_entry_before' ); do_action( 'tha_entry_before' ); } // /wmhook_entry_before function wmhook_entry_after() { do_action( 'wmhook_entry_after' ); do_action( 'tha_entry_after' ); } // /wmhook_entry_after function wmhook_entry_top() { do_action( 'wmhook_entry_top' ); do_action( 'tha_entry_top' ); } // /wmhook_entry_top function wmhook_entry_bottom() { do_action( 'wmhook_entry_bottom' ); do_action( 'tha_entry_bottom' ); } // /wmhook_entry_bottom /** * $tha_supports[] = 'comments'; */ /** * Comments block hooks */ function wmhook_comments_before() { do_action( 'wmhook_comments_before' ); do_action( 'tha_comments_before' ); } // /wmhook_comments_before function wmhook_comments_after() { do_action( 'wmhook_comments_after' ); do_action( 'tha_comments_after' ); } // /wmhook_comments_after /** * $tha_supports[] = 'sidebar'; */ /** * Semantic hooks */ function wmhook_sidebars_before() { do_action( 'wmhook_sidebars_before' ); do_action( 'tha_sidebars_before' ); } // /wmhook_sidebars_before function wmhook_sidebars_after() { do_action( 'wmhook_sidebars_after' ); do_action( 'tha_sidebars_after' ); } // /wmhook_sidebars_after function wmhook_sidebar_top() { do_action( 'wmhook_sidebar_top' ); do_action( 'tha_sidebar_top' ); } // /wmhook_sidebar_top function wmhook_sidebar_bottom() { do_action( 'wmhook_sidebar_bottom' ); do_action( 'tha_sidebar_bottom' ); } // /wmhook_sidebar_bottom /** * $tha_supports[] = 'footer'; */ /** * Semantic