<?php
/**
 * Calls in content using theme hooks.
 *
 * @package code4rest
 */

namespace Code4rest;

use function Code4rest\code4rest;
use function add_action;

defined( 'ABSPATH' ) || exit;

/**
 * Code4rest Header.
 *
 * @see Code4rest\header_markup();
 */
add_action( 'code4rest_header', 'Code4rest\header_markup' );

/**
 * Code4rest Header Rows
 *
 * @see Code4rest\top_header();
 * @see Code4rest\main_header();
 * @see Code4rest\bottom_header();
 */
add_action( 'code4rest_top_header', 'Code4rest\top_header' );
add_action( 'code4rest_main_header', 'Code4rest\main_header' );
add_action( 'code4rest_bottom_header', 'Code4rest\bottom_header' );

/**
 * Code4rest Header Columns
 *
 * @see Code4rest\header_column();
 */
add_action( 'code4rest_render_header_column', 'Code4rest\header_column', 10, 2 );

/**
 * Code4rest Mobile Header
 *
 * @see Code4rest\mobile_header();
 */
add_action( 'code4rest_mobile_header', 'Code4rest\mobile_header' );

/**
 * Code4rest Mobile Header Rows
 *
 * @see Code4rest\mobile_top_header();
 * @see Code4rest\mobile_main_header();
 * @see Code4rest\mobile_bottom_header();
 */
add_action( 'code4rest_mobile_top_header', 'Code4rest\mobile_top_header' );
add_action( 'code4rest_mobile_main_header', 'Code4rest\mobile_main_header' );
add_action( 'code4rest_mobile_bottom_header', 'Code4rest\mobile_bottom_header' );

/**
 * Code4rest Mobile Header Columns
 *
 * @see Code4rest\mobile_header_column();
 */
add_action( 'code4rest_render_mobile_header_column', 'Code4rest\mobile_header_column', 10, 2 );

/**
 * Desktop Header Elements.
 *
 * @see Code4rest\site_branding();
 * @see Code4rest\primary_navigation();
 * @see Code4rest\secondary_navigation();
 * @see Code4rest\header_html();
 * @see Code4rest\header_button();
 * @see Code4rest\header_cart();
 * @see Code4rest\header_social();
 * @see Code4rest\header_search();
 */
add_action( 'code4rest_site_branding', 'Code4rest\site_branding' );
add_action( 'code4rest_primary_navigation', 'Code4rest\primary_navigation' );
add_action( 'code4rest_secondary_navigation', 'Code4rest\secondary_navigation' );
add_action( 'code4rest_header_html', 'Code4rest\header_html' );
add_action( 'code4rest_header_button', 'Code4rest\header_button' );
add_action( 'code4rest_header_cart', 'Code4rest\header_cart' );
add_action( 'code4rest_header_social', 'Code4rest\header_social' );
add_action( 'code4rest_header_search', 'Code4rest\header_search' );
/**
 * Mobile Header Elements.
 *
 * @see Code4rest\mobile_site_branding();
 * @see Code4rest\navigation_popup_toggle();
 * @see Code4rest\mobile_navigation();
 * @see Code4rest\mobile_html();
 * @see Code4rest\mobile_button();
 * @see Code4rest\mobile_cart();
 * @see Code4rest\mobile_social();
 * @see Code4rest\primary_navigation();
 */
add_action( 'code4rest_mobile_site_branding', 'Code4rest\mobile_site_branding' );
add_action( 'code4rest_navigation_popup_toggle', 'Code4rest\navigation_popup_toggle' );
add_action( 'code4rest_mobile_navigation', 'Code4rest\mobile_navigation' );
add_action( 'code4rest_mobile_html', 'Code4rest\mobile_html' );
add_action( 'code4rest_mobile_button', 'Code4rest\mobile_button' );
add_action( 'code4rest_mobile_cart', 'Code4rest\mobile_cart' );
add_action( 'code4rest_mobile_social', 'Code4rest\mobile_social' );

/**
 * Hero Title
 *
 * @see Code4rest\hero_title();
 */
add_action( 'code4rest_hero_header', 'Code4rest\hero_title' );

/**
 * Page Title area
 *
 * @see Code4rest\code4rest_entry_header();
 */
add_action( 'code4rest_entry_hero', 'Code4rest\code4rest_entry_header', 10, 2 );
add_action( 'code4rest_entry_header', 'Code4rest\code4rest_entry_header', 10, 2 );

/**
 * Archive Title area
 *
 * @see Code4rest\code4rest_entry_archive_header();
 */
add_action( 'code4rest_entry_archive_hero', 'Code4rest\code4rest_entry_archive_header', 10, 2 );
add_action( 'code4rest_entry_archive_header', 'Code4rest\code4rest_entry_archive_header', 10, 2 );

/**
 * Singular Content
 *
 * @see Code4rest\single_markup();
 */
add_action( 'code4rest_single', 'Code4rest\single_markup' );

/**
 * Singular Inner Content
 *
 * @see Code4rest\single_content();
 */
add_action( 'code4rest_single_content', 'Code4rest\single_content' );

/**
 * 404 Content
 *
 * @see Code4rest\get_404_content();
 */
add_action( 'code4rest_404_content', 'Code4rest\get_404_content' );

/**
 * Comments List
 *
 * @see Code4rest\comments_list();
 */
add_action( 'code4rest_comments', 'Code4rest\comments_list' );

/**
 * Comment Form
 *
 * @see Code4rest\comments_form();
 */
function check_comments_form_order() {
	$priority = ( code4rest()->option( 'comment_form_before_list' ) ? 5 : 15 );
	add_action( 'code4rest_comments', 'Code4rest\comments_form', $priority );
}
add_action( 'code4rest_comments', 'Code4rest\check_comments_form_order', 1 );
/**
 * Archive Content
 *
 * @see Code4rest\archive_markup();
 */
add_action( 'code4rest_archive', 'Code4rest\archive_markup' );

/**
 * Archive Entry Content.
 *
 * @see Code4rest\loop_entry();
 */
add_action( 'code4rest_loop_entry', 'Code4rest\loop_entry' );

/**
 * Archive Entry thumbnail.
 *
 * @see Code4rest\loop_entry_thumbnail();
 */
add_action( 'code4rest_loop_entry_thumbnail', 'Code4rest\loop_entry_thumbnail' );

/**
 * Archive Entry header.
 *
 * @see Code4rest\loop_entry_header();
 */
add_action( 'code4rest_loop_entry_content', 'Code4rest\loop_entry_header', 10 );
/**
 * Archive Entry Summary.
 *
 * @see Code4rest\loop_entry_summary();
 */
add_action( 'code4rest_loop_entry_content', 'Code4rest\loop_entry_summary', 20 );
/**
 * Archive Entry Footer.
 *
 * @see Code4rest\loop_entry_footer();
 */
add_action( 'code4rest_loop_entry_content', 'Code4rest\loop_entry_footer', 30 );

/**
 * Archive Entry Taxonomies.
 *
 * @see Code4rest\loop_entry_taxonomies();
 */
add_action( 'code4rest_loop_entry_header', 'Code4rest\loop_entry_taxonomies', 10 );
/**
 * Archive Entry Title.
 *
 * @see Code4rest\loop_entry_title();
 */
add_action( 'code4rest_loop_entry_header', 'Code4rest\loop_entry_title', 20 );
/**
 * Archive Entry Meta.
 *
 * @see Code4rest\loop_entry_meta();
 */
add_action( 'code4rest_loop_entry_header', 'Code4rest\loop_entry_meta', 30 );

/**
 * Main Call for Code4rest footer
 *
 * @see Code4rest\footer_markup();
 */
add_action( 'code4rest_footer', 'Code4rest\footer_markup' );

/**
 * Footer Top Row
 *
 * @see Code4rest\top_footer();
 */
add_action( 'code4rest_top_footer', 'Code4rest\top_footer' );

/**
 * Footer Middle Row
 *
 * @see Code4rest\middle_footer()
 */
add_action( 'code4rest_middle_footer', 'Code4rest\middle_footer' );

/**
 * Footer Bottom Row
 *
 * @see Code4rest\bottom_footer()
 */
add_action( 'code4rest_bottom_footer', 'Code4rest\bottom_footer' );

/**
 * Footer Column
 *
 * @see Code4rest\footer_column()
 */
add_action( 'code4rest_render_footer_column', 'Code4rest\footer_column', 10, 2 );


/**
 * Footer Elements
 *
 * @see Code4rest\footer_html();
 * @see Code4rest\footer_navigation()
 * @see Code4rest\footer_social()
 */
add_action( 'code4rest_footer_html', 'Code4rest\footer_html' );
add_action( 'code4rest_footer_navigation', 'Code4rest\footer_navigation' );
add_action( 'code4rest_footer_social', 'Code4rest\footer_social' );

/**
 * WP Footer.
 *
 * @see Code4rest\scroll_up();
 */
add_action( 'wp_footer', 'Code4rest\scroll_up' );
