<commit_before><?php
function is_test(){
	if(isset($_REQUEST['reversetest'])):
		return false;
	elseif(isset($_REQUEST['prev'])):
		return true;
	elseif($_SERVER['REMOTE_ADDR'] == '172.16.17.32'):
		return true;
	else:
		return false;
	endif;
}

if(is_test()):
	define('WP_DEBUG_LOG', false);
	define('SCRIPT_DEBUG', false);
	define('WP_DEBUG', true);
	@ini_set('display_errors',0);
	@ini_set('ignore_repeated_errors',1);
	@ini_set( 'log_errors', 1 );
	@ini_set( 'error_log', get_template_directory() . '/debug.log' );
else:
	@ini_set('display_errors',0);
	define('WP_DEBUG', false);
	define('WP_DEBUG_DISPLAY', false);
endif;

add_filter( 'auto_update_core', '__return_false' );
function cmb_initialize_cmb_meta_boxes() {
	if (!class_exists( 'cmb_Meta_Box' ) ){
		require_once 'vendor/lib-meta/init.php';
	}
}
add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );

if (!class_exists( 'customPostType' ) ){
	require_once 'vendor/custom-post-types.php';
}


require_once 'base/archive-helpers.php';
require_once 'base/disable-feeds.php';
require_once 'base/image.php';
require_once 'base/post-types.php';
require_once 'base/shortcodes.php';
require_once 'base/form-builder.php';
require_once 'base/meta-fields.php';



/*************************************************************************************/
/** Theme By Theme Customization **/
//add_image_size( $name, $width, $height, $crop );
add_theme_support( 'html5', array( 'search-form' ) );

add_theme_support( 'post-thumbnails' );
add_image_size( 'page-banner', '1400', '377', false );
add_image_size( 'home-banner', '1600', '600', false );
add_image_size( 'sqr_450', '450', '450', true);
add_image_size( 'sqr_300', '300', '300', true);
add_image_size( 'sqr_210', '210', '210', true);
//add_image_size( 'preview', '300', '300', true);


/*add_image_size( 'sqr_750', '750', '750', true);
add_image_size( 'sqr_600', '600', '600', true);

add_image_size( 'sqr_450', '450', '450', true);
add_image_size( 'sqr_300', '300', '300', true);
add_image_size( 'sqr_200', '200', '200', true);*/


function load_admin_functions() {
	/* Serif fonts are for print. */
	if (is_admin()) {
		add_editor_style('css/editor-style.css');
	}
	register_nav_menus(
		array(
			'header-menu-desktop' => __( 'Desktop Header Menu' ),
			'footer-menu-desktop' => __( 'Desktop Footer Menu' ),
			//'header-menu-mobile' => __( 'Mobile Header Menu' ),
			//'footer-menu-mobile' => __( 'Mobile Footer Menu' )
		)
	);
}

add_action( 'init', 'load_admin_functions' );

function get_theme_path($withSlash = false, $extraPath = '') {
	$morePath = '';
	if ($withSlash == true) {
		$morePath .= '/';
	}
	if ($extraPath !== '') {
		$morePath .= $extraPath;
	}

	return get_template_directory_uri() . $morePath;
}

function get_meta($id, $field){
	$prefix = get_the_prefix();
	return get_post_meta($id, $prefix.$field, true);
}


function get_languages_short($includeActive = false) {
	if(function_exists('icl_get_languages')):
		$languages = icl_get_languages('skip_missing=0');
		if (1 < count($languages)):
			$langReturn = array();
			foreach ($languages as $l):
				if($includeActive):
					$return = "<a href='{$l['url']}'".($l['active'] ? " class='active'" : '').">";
					$return .= substr($l['language_code'],0,2);
					$return .= "</a>";
					$langReturn[] =  $return;
				else:
					if (!$l['active']) $langReturn[] =  '<a href="' . $l['url'] . '">' . $l['language_code'] . '</a>';
				endif;

			endforeach;
			return $langReturn;
		endif;
	endif;
	return '';
}

function get_languages_long($includeActive = false) {
	if(function_exists('icl_get_languages')):
		$languages = icl_get_languages('skip_missing=0');
		if (1 < count($languages)):
			$langReturn = array();
			foreach ($languages as $l):
				if($includeActive):
					$return = "<a href='{$l['url']}'".($l['active'] ? " class='active'" : '').">";
					$return .= $l['native_name'];
					$return .= "</a>";
					$langReturn[] =  $return;
				else:
					if (!$l['active']) $langReturn[] =  '<a href="' . $l['url'] . '">' . $l['native_name'] . '</a>';
				endif;
			endforeach;
			return $langReturn;
		endif;
	endif;
	return '';
}

function get_lang_active($validateAgainst = false) {
	$activeLang = 'en';
	if(class_exists('SitePress')){
		global $sitepress;
		$activeLang = substr($sitepress->get_current_language(),0,2);
	}

	if(!$validateAgainst){
		return $activeLang;
	}else{
		return ($activeLang == $validateAgainst);
	}
}
function get_lang_code($activeLang = false) {
	if(class_exists('SitePress')){
		if(!$activeLang):
			$activeLang = get_lang_active();
		endif;<commit_msg>get languages now returns empty array if no languages active<commit_after><?php
function is_test(){
	if(isset($_REQUEST['reversetest'])):
		return false;
	elseif(isset($_REQUEST['prev'])):
		return true;
	elseif($_SERVER['REMOTE_ADDR'] == '172.16.17.32'):
		return true;
	else:
		return false;
	endif;
}

if(is_test()):
	define('WP_DEBUG_LOG', false);
	define('SCRIPT_DEBUG', false);
	define('WP_DEBUG', true);
	@ini_set('display_errors',0);
	@ini_set('ignore_repeated_errors',1);
	@ini_set( 'log_errors', 1 );
	@ini_set( 'error_log', get_template_directory() . '/debug.log' );
else:
	@ini_set('display_errors',0);
	define('WP_DEBUG', false);
	define('WP_DEBUG_DISPLAY', false);
endif;

add_filter( 'auto_update_core', '__return_false' );
function cmb_initialize_cmb_meta_boxes() {
	if (!class_exists( 'cmb_Meta_Box' ) ){
		require_once 'vendor/lib-meta/init.php';
	}
}
add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );

if (!class_exists( 'customPostType' ) ){
	require_once 'vendor/custom-post-types.php';
}


require_once 'base/archive-helpers.php';
require_once 'base/disable-feeds.php';
require_once 'base/image.php';
require_once 'base/post-types.php';
require_once 'base/shortcodes.php';
require_once 'base/form-builder.php';
require_once 'base/meta-fields.php';



/*************************************************************************************/
/** Theme By Theme Customization **/
//add_image_size( $name, $width, $height, $crop );
add_theme_support( 'html5', array( 'search-form' ) );

add_theme_support( 'post-thumbnails' );
add_image_size( 'page-banner', '1400', '377', false );
add_image_size( 'home-banner', '1600', '600', false );
add_image_size( 'sqr_450', '450', '450', true);
add_image_size( 'sqr_300', '300', '300', true);
add_image_size( 'sqr_210', '210', '210', true);
//add_image_size( 'preview', '300', '300', true);


/*add_image_size( 'sqr_750', '750', '750', true);
add_image_size( 'sqr_600', '600', '600', true);

add_image_size( 'sqr_450', '450', '450', true);
add_image_size( 'sqr_300', '300', '300', true);
add_image_size( 'sqr_200', '200', '200', true);*/


function load_admin_functions() {
	/* Serif fonts are for print. */
	if (is_admin()) {
		add_editor_style('css/editor-style.css');
	}
	register_nav_menus(
		array(
			'header-menu-desktop' => __( 'Desktop Header Menu' ),
			'footer-menu-desktop' => __( 'Desktop Footer Menu' ),
			//'header-menu-mobile' => __( 'Mobile Header Menu' ),
			//'footer-menu-mobile' => __( 'Mobile Footer Menu' )
		)
	);
}

add_action( 'init', 'load_admin_functions' );

function get_theme_path($withSlash = false, $extraPath = '') {
	$morePath = '';
	if ($withSlash == true) {
		$morePath .= '/';
	}
	if ($extraPath !== '') {
		$morePath .= $extraPath;
	}

	return get_template_directory_uri() . $morePath;
}

function get_meta($id, $field){
	$prefix = get_the_prefix();
	return get_post_meta($id, $prefix.$field, true);
}


function get_languages_short($includeActive = false) {
	if(function_exists('icl_get_languages')):
		$languages = icl_get_languages('skip_missing=0');
		$langReturn = array();
		if (1 < count($languages)):
			foreach ($languages as $l):
				if($includeActive):
					$return = "<a href='{$l['url']}'".($l['active'] ? " class='active'" : '').">";
					$return .= substr($l['language_code'],0,2);
					$return .= "</a>";
					$langReturn[] =  $return;
				else:
					if (!$l['active']) $langReturn[] =  '<a href="' . $l['url'] . '">' . $l['language_code'] . '</a>';
				endif;

			endforeach;
		endif;
		return $langReturn;
	endif;
	return '';
}

function get_languages_long($includeActive = false) {
	if(function_exists('icl_get_languages')):
		$languages = icl_get_languages('skip_missing=0');
		$langReturn = array();
		if (1 < count($languages)):
			foreach ($languages as $l):
				if($includeActive):
					$return = "<a href='{$l['url']}'".($l['active'] ? " class='active'" : '').">";
					$return .= $l['native_name'];
					$return .= "</a>";
					$langReturn[] =  $return;
				else:
					if (!$l['active']) $langReturn[] =  '<a href="' . $l['url'] . '">' . $l['native_name'] . '</a>';
				endif;
			endforeach;
		endif;
		return $langReturn;
	endif;
	return '';
}

function get_lang_active($validateAgainst = false) {
	$activeLang = 'en';
	if(class_exists('SitePress')){
		global $sitepress;
		$activeLang = substr($sitepress->get_current_language(),0,2);
	}

	if(!$validateAgainst){
		return $activeLang;
	}else{
		return ($activeLang == $validateAgainst);
	}
}
function get_lang_code($activeLang = false) {
	if(class_exists('SitePress')){
		if(!$activeLang):
			$activeLang = get_lang_active();
		endif;
{'fraction_non_alphanumeric': 0.22246384690659998, 'fraction_numerical': 0.02566054148091769, 'mean_word_length': 5.148395721925134, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '478840', 'n_tokens_mistral': 3756, 'n_tokens_neox': 3384, 'n_words': 624}