<?php
/**
 * Theme template hooks.
 */

/**
 * Global.
 *
 * @see basho_no_js_class()
 * @see basho_body_classes()
 * @see basho_filter_nav_menu_css_class()
 * @see basho_filter_offcanvas_nav_menu_css_class()
 * @see basho_filter_main_nav_menu_item_args()
 * @see basho_filter_social_menu_icons()
 * @see basho_filter_the_archive_title()
 * @see basho_filter_comments_popup_link_attributes()
 */
add_action( 'wp_head',                          'basho_no_js_class' );
add_filter( 'body_class',                       'basho_body_classes' );
add_filter( 'nav_menu_css_class',               'basho_filter_offcanvas_nav_menu_css_class', 10, 4 );
add_filter( 'nav_menu_item_args',               'basho_filter_main_nav_menu_item_args', 10, 3 );
add_filter( 'nav_menu_link_attributes',         'basho_filter_social_menu_icons', 10, 3 );
add_filter( 'get_the_archive_title',            'basho_filter_the_archive_title', 10, 1 );
add_filter( 'comments_popup_link_attributes',   'basho_filter_comments_popup_link_attributes', 10, 1 );

/**
 * Header.
 *
 * @see basho_skip_link()
 * @see basho_offcanvas_navigation_toggle()
 * @see basho_header_logotype()
 * @see basho_filter_get_custom_logo()
 * @see basho_header_navbar()
 * @see basho_header_search_form()
 * @see basho_header_search_modal_toggle()
 * @see basho_offcanvas_navigation_toggle_no_woocommerce()
 */
add_action( 'wp_body_open',              'basho_skip_link', 10 );
add_action( 'basho_header_left',           'basho_offcanvas_navigation_toggle', 5 );
add_action( 'basho_header_left',           'basho_header_logotype', 10 );
add_filter( 'get_custom_logo',           'basho_filter_get_custom_logo' );
add_action( 'basho_header_left',           'basho_header_navbar', 10 );
add_action( 'basho_header_center',         'basho_header_search_form', 10 );
add_action( 'basho_header_right',          'basho_header_search_modal_toggle', 10 );
add_action( 'basho_header_right',          'basho_offcanvas_navigation_toggle_no_woocommerce', 10 );

/**
 * Content
 *
 * @see basho_archive_header()
 * @see basho_blog_categories()
 * @see basho_loop_wrapper_start()
 * @see basho_loop_wrapper_end()
 */
add_action( 'basho_site_content_header',   'basho_archive_header', 10 );
add_action( 'basho_before_loop',           'basho_blog_categories', 10 );
add_action( 'basho_before_loop',           'basho_loop_wrapper_start', 10 );
add_action( 'basho_after_loop',            'basho_loop_wrapper_end', 10 );

/**
 * Footer.
 *
 * @see basho_footer_sidebars()
 *
 * @see basho_print_footer_left_section()
 * @see basho_print_footer_center_section()
 * @see basho_print_footer_right_section()
 *
 * @see basho_offcanvas_navigation()
 * @see basho_search_modal()
 */
add_action( 'basho_before_footer',         'basho_footer_sidebars', 5 );

add_action( 'basho_footer',                'basho_print_footer_left_section', 5 );
add_action( 'basho_footer',                'basho_print_footer_center_section', 10 );
add_action( 'basho_footer',                'basho_print_footer_right_section', 20 );

add_action( 'basho_after_footer',          'basho_offcanvas_navigation', 5 );
add_action( 'basho_after_footer',          'basho_search_modal', 10 );
