<?php
if (!function_exists('pac_drh_init_features')):
    function pac_drh_init_features()
    {
        // Include WP miscellaneous hooks function
        require_once 'modules/wp-misc-hooks.php';
        // Include custom media queries functions
        require_once 'modules/divi-custom-media-query.php';
        // Include miscellaneous functions
        require_once 'modules/divi-miscellaneous.php';
        // Include custom header functions
        require_once 'modules/divi-custom-header.php';
        // Include customizer values update function
        require_once 'modules/divi-custom-layout.php';
        // Include row layout customization functions
        require_once 'modules/divi-custom-row-layout.php';
        // Include widow fixer function if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_widow_fixer')) {
            require_once 'modules/divi-widow-fixer.php';
        }
        // Include typography function if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_text_sizes')) {
            require_once 'modules/divi-typography.php';
        }
        // Include custom gutter width function if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_custom_gutter_width')) {
            require_once 'modules/divi-custom-gutter.php';
        }
        // Include menu module settings function if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_menu_module_settings')) {
            require_once 'modules/divi-menu-module.php';
        }
        // Include Divi column stacking and number functions
        require_once 'modules/divi-column-stacking-and-number.php';
        // Include gallery module functions
        require_once 'modules/divi-gallery-module.php';
        // Include blog module functions
        require_once 'modules/divi-blog-module.php';
        // Include WooCommerce products module functions
        require_once 'modules/divi-shop-module.php';
        // Include portfolio module functions
        require_once 'modules/divi-portfolio-module.php';
        // Include blurb module functions if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_blurb_settings')) {
            require_once 'modules/divi-blurb-module.php';
        }
        // Include tab module functions if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_tabs_layout_settings')) {
            require_once 'modules/divi-tabs-module.php';
        }
        // Include WP nav menu filters function if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_show_hide_menu_item')) {
            require_once 'modules/wp-nav-menu.php';
        }
        // Include related products module functions if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_related_products_number_of_columns')) {
            require_once 'modules/divi-related-products-module.php';
        }
        // Include cross-sells products module functions if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_crosssells_number_of_columns')) {
            require_once 'modules/divi-cross-sells-products-module.php';
        }
        // Include upsells products module functions if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_upsells_number_of_columns')) {
            require_once 'modules/divi-up-sells-products-module.php';
        }
        // Include image module functions if enabled
        if (pac_drh_get_settings_enabled('pac_drh_enable_responsive_image_lightbox')) {
            require_once 'modules/divi-image-module.php';
        }
        //
        require_once 'modules/divi-custom-break-points.php';
    }

    add_action('divi_extensions_init', 'pac_drh_init_features');
endif;
