<?php
/**
* Custom Hooks
*
* @package GridFeel WordPress Theme
* @copyright Copyright (C) 2025 ThemesDNA
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
* @author ThemesDNA <themesdna@gmail.com>
*/

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

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

function gridfeel_before_main_content() {
    do_action('gridfeel_before_main_content');
}
add_action('gridfeel_before_main_content', 'gridfeel_top_widgets', 20 );
add_action('gridfeel_before_main_content', 'gridfeel_top_left_right_widgets', 40 );

function gridfeel_after_main_content() {
    do_action('gridfeel_after_main_content');
}
add_action('gridfeel_after_main_content', 'gridfeel_bottom_widgets', 10 );

function gridfeel_sidebar_one() {
    do_action('gridfeel_sidebar_one');
}
add_action('gridfeel_sidebar_one', 'gridfeel_sidebar_one_widgets', 10 );

function gridfeel_sidebar_two() {
    do_action('gridfeel_sidebar_two');
}
add_action('gridfeel_sidebar_two', 'gridfeel_sidebar_two_widgets', 10 );

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

if ( !(gridfeel_get_option('enable_widgets_block_editor')) ) {
    // Disables the block editor from managing widgets in the Gutenberg plugin.
    add_filter( 'gutenberg_use_widgets_block_editor', '__return_false', 100 );

    // Disables the block editor from managing widgets.
    add_filter( 'use_widgets_block_editor', '__return_false' );
}

if ( ! function_exists( 'gridfeel_remove_theme_support' ) ) :
function gridfeel_remove_theme_support() {

    if ( gridfeel_is_fitvids_active() ) {
        // Remove responsive embedded content support.
        remove_theme_support( 'responsive-embeds' );
    }

}
endif;
add_action( 'after_setup_theme', 'gridfeel_remove_theme_support', 1000 );