AnonSec Team
Server IP : 10.128.40.6  /  Your IP : 216.73.216.233
Web Server : Apache
System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : logmcpe ( 111175)
PHP Version : 7.3.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/logmcpe/www/TEST/www/wp-content/plugins/wp/../../themes/cleanmate/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TEST/www/wp-content/plugins/wp/../../themes/cleanmate/functions.php
<?php
$themename = "cleanmate";
if(function_exists('set_revslider_as_theme'))
{
	function cm_set_revolution_as_theme() 
	{
		set_revslider_as_theme();
	}
	add_action('init', 'cm_set_revolution_as_theme');
}

//plugins activator
require_once("plugins_activator.php");

//for is_plugin_active
include_once( ABSPATH . 'wp-admin/includes/plugin.php');

if(function_exists("vc_remove_element"))
{
	vc_remove_element("vc_gmaps");
	vc_remove_element("vc_tour");
}

//theme options
cm_get_theme_file("/theme-options.php");

//menu walker
cm_get_theme_file("/mobile_menu_walker.php");

//custom meta box
cm_get_theme_file("/meta-box.php");

if(function_exists("vc_map"))
{
	//contact_form
	cm_get_theme_file("/contact_form.php");
	//shortcodes
	cm_get_theme_file("/shortcodes/shortcodes.php");
}

//comments
cm_get_theme_file("/comments-functions.php");

//widgets
cm_get_theme_file("/widgets/widget-contact-info.php");
cm_get_theme_file("/widgets/widget-contact-details.php");
cm_get_theme_file("/widgets/widget-contact-details-list.php");
cm_get_theme_file("/widgets/widget-list.php");
cm_get_theme_file("/widgets/widget-recent.php");
cm_get_theme_file("/widgets/widget-social-icons.php");
cm_get_theme_file("/widgets/widget-cart-icon.php");
cm_get_theme_file("/widgets/widget-search.php");

function cm_theme_after_setup_theme()
{
	//set default theme options
	if(!get_option("cm_installed") || !get_option("wpb_js_content_types"))
	{		
		$theme_options = array(
			"favicon_url" => get_template_directory_uri() . "/images/favicon.ico",
			"logo_url" => get_template_directory_uri() . "/images/logo.png",
			"alternative_logo_url" => get_template_directory_uri() . "/images/logo_transparent.png",
			"logo_retina_url" => get_template_directory_uri() . "/images/logo_retina.png",
			"alternative_logo_retina_url" => get_template_directory_uri() . "/images/logo_transparent_retina.png",
			"logo_text" => __("CLEANMATE", 'cleanmate'),
			"footer_text" => sprintf(__('© Copyright 2020 <a target="_blank" title="%s" href="%s" rel="nofollow">CleanMate Theme</a> by <a target="_blank" title="%s" href="%s">QuanticaLabs</a>', 'cleanmate'), esc_html__('CleanMate Theme', 'cleanmate'), esc_url(__('https://1.envato.market/cleanmate-cleaning-company-maid-gardening-wordpress-theme', 'cleanmate')), esc_html__('QuanticaLabs', 'cleanmate'), esc_url(__('http://quanticalabs.com', 'cleanmate'))),
			"sticky_menu" => 1,
			"responsive" => 1,
			"scroll_top" => 1,
			"layout" => 'fullwidth',
			"layout_style" => '',
			"layout_image_overlay" => '',
			"style_selector" => 0,
			"direction" => "default",
			"collapsible_mobile_submenus" => 1,
			"google_api_code" => "",
			"google_recaptcha" => "",
			"google_recaptcha_comments" => "",
			"recaptcha_site_key" => "",
			"recaptcha_secret_key" => "",
			"ga_tracking_code" => "",
			"cf_admin_name" => get_option("admin_email"),
			"cf_admin_email" => get_option("admin_email"),
			"cf_smtp_host" => "",
			"cf_smtp_username" => "",
			"cf_smtp_password" => "",
			"cf_smtp_port" => "",
			"cf_smtp_secure" => "",
			"cf_email_subject" => __("CleanMate WP: Contact from WWW", 'cleanmate'),
			"cf_template" => "<html>
	<head>
	</head>
	<body>
		<div><b>Name</b>: [name]</div>
		<div><b>E-mail</b>: [email]</div>
		<div><b>Phone</b>: [phone]</div>
		<div><b>Message</b>: [message]</div>
		[form_data]
	</body>
</html>",
			"cf_name_message" => __("Please enter your name.", 'cleanmate'),
			"cf_email_message" => __("Please enter valid e-mail.", 'cleanmate'),
			"cf_phone_message" => __("Please enter your phone number.", 'cleanmate'),
			"cf_message_message" => __("Please enter your message.", 'cleanmate'),
			"cf_recaptcha_message" => __("Please verify captcha.", 'cleanmate'),
			"cf_terms_message" => __("Checkbox is required.", 'cleanmate'),
			"cf_thankyou_message" => __("Thank you for contacting us", 'cleanmate'),
			"cf_error_message" => __("Sorry, we can't send this message", 'cleanmate'),
			"cf_name_message_comments" => __("Please enter your name.", 'cleanmate'),
			"cf_email_message_comments" => __("Please enter valid e-mail.", 'cleanmate'),
			"cf_comment_message_comments" => __("Please enter your message.", 'cleanmate'),
			"cf_recaptcha_message_comments" => __("Please verify captcha.", 'cleanmate'),
			"cf_terms_message_comments" => __("Checkbox is required.", 'cleanmate'),
			"cf_thankyou_message_comments" => __("Your comment has been added.", 'cleanmate'),
			"cf_error_message_comments" => __("Error while adding comment.", 'cleanmate'),
			"site_background_color" => '',
			"main_color" => '',
			"header_type" => 'type_1',
			"header_top_sidebar" => '',
			"header_menu_sidebar" => '',
			"primary_font" => '',
			"primary_font_subset" => '',
			"primary_font_custom" => '',
			"secondary_font" => '',
			"secondary_font_subset" => '',
			"secondary_font_custom" => ''
		);
		add_option("cm_options", $theme_options);
		
		add_option("wpb_js_content_types", array(
			"page",
			"ql_projects",
			"ql_services",
			"ql_team")
		);
		
		global $wp_rewrite;
		$wp_rewrite->flush_rules();
		add_option("cm_installed", 1);
	}
	//set default cost calculator options
	if(is_plugin_active("ql-cost-calculator/ql-cost-calculator.php"))
	{
		if(!get_option("cm_cost_calculator_installed"))
		{
			$cost_calculator_global_form_options = array(
				"calculator_skin" => "default",
				"main_color" => "",
				"box_color" => "FFFFFF",
				"text_color" => "",
				"border_color" => "",
				"label_color" => "",
				"form_label_color" => "",
				"inactive_color" => "",
				"primary_font_custom" => "",
				"primary_font" => "",
				"primary_font_subset" => "",
				"secondary_font_custom" => "",
				"secondary_font" => "",
				"secondary_font_subset" => "",
				"send_email" => 1,
				"save_calculation" => 1,
				"calculation_status" => "draft",
				"google_recaptcha" => 0,
				"recaptcha_site_key" => "",
				"recaptcha_secret_key" => ""
			);
			update_option("cost_calculator_global_form_options", $cost_calculator_global_form_options);
			add_option("cm_cost_calculator_installed", 1);
		}
	}
	if(is_plugin_active('revslider/revslider.php') && !get_option("cm_revslider_options_defined"))
	{
		$data = (array)get_option('revslider-global-settings');
		$data['width'] = '1920';
		$data['width_notebook'] = '1173';
		$data['width_tablet'] = '751';
		$data['width_mobile'] = '463';
		update_option('revslider-global-settings', $data);
		add_option("cm_revslider_options_defined", 1);
	}
	
	//Make theme available for translation
	//Translations can be filed in the /languages/ directory
	load_theme_textdomain('cleanmate', get_template_directory() . '/languages');
	
	//woocommerce
	add_theme_support("woocommerce", array(
		'gallery_thumbnail_image_width' => 150)
	);
	add_theme_support("wc-product-gallery-zoom");
	add_theme_support("wc-product-gallery-lightbox");
	add_theme_support("wc-product-gallery-slider");
	
	//register thumbnails
	add_theme_support("post-thumbnails");
	
	add_image_size("blog-post-thumb", 870, 400, true);
	add_image_size("large-thumb", 960, 750, true);
	add_image_size("big-thumb", 640, 480, true);
	add_image_size("medium-rectangle-thumb", 480, 693, true);
	add_image_size("medium-square-thumb", 480, 480, true);
	add_image_size("medium-thumb", 480, 320, true);
	add_image_size("small-thumb", 370, 246, true);
	add_image_size("small-square-thumb", 260, 260, true);
	add_image_size("tiny-thumb", 90, 90, true);
	
	//enable custom background
	add_theme_support("custom-background"); //3.4
	
	//enable feed links
	add_theme_support("automatic-feed-links");
	
	//title tag
	add_theme_support("title-tag");
	
	//gutenberg
	add_theme_support("wp-block-styles");
	add_theme_support("align-wide");
	add_theme_support("editor-color-palette", array(
		array(
			'name' => __("cleanmate green", 'cleanmate'),
			'slug' => 'cleanmate-green',
			'color' => '#56B665',
		),
		array(
			'name' => __("cleanmate orange", 'cleanmate' ),
			'slug' => 'cleanmate-orange',
			'color' => '#DAA533',
		),
		array(
			'name' => __("cleanmate blue", 'cleanmate' ),
			'slug' => 'cleanmate-blue',
			'color' => '#75A3C0',
		),
		array(
			'name' => __("cleanmate red", 'cleanmate' ),
			'slug' => 'cleanmate-red',
			'color' => '#DE9876',
		),
		array(
			'name' => __("cleanmate light blue", 'cleanmate' ),
			'slug' => 'cleanmate-light-blue',
			'color' => '#36B4B6',
		),
		array(
			'name' => __("cleanmate violet", 'cleanmate' ),
			'slug' => 'cleanmate-violet',
			'color' => '#9884B8',
		)
	));

	//register menus
	if(function_exists("register_nav_menu"))
	{
		register_nav_menu("main-menu", "Main Menu");
		register_nav_menu("main-menu-1", "Main Menu 1");
		register_nav_menu("main-menu-2", "Main Menu 2");
	}
	
	//custom theme filters
	add_filter('upload_mimes', 'cm_custom_upload_files');
	//using shortcodes in sidebar
	add_filter("widget_text", "do_shortcode");
	add_filter("image_size_names_choose", "cm_theme_image_sizes");
	add_filter('wp_list_categories','cm_category_count_span');
	add_filter('get_archives_link', 'cm_archive_count_span');
	add_filter('excerpt_more', 'cm_theme_excerpt_more', 99);
	add_filter('post_class', 'cm_check_image');
	add_filter('user_contactmethods', 'cm_contactmethods', 10, 1);
	add_filter('wp_title', 'cm_wp_title_filter', 10, 2);
	add_filter('site_transient_update_plugins', 'cm_filter_update_vc_plugin', 10, 2);
	
	//custom theme woocommerce filters
	add_filter('woocommerce_pagination_args' , 'cm_woo_custom_override_pagination_args');
	add_filter('woocommerce_product_single_add_to_cart_text', 'cm_woo_custom_cart_button_text');
	add_filter('woocommerce_product_add_to_cart_text', 'cm_woo_custom_cart_button_text');
	add_filter('loop_shop_columns', 'cm_woo_custom_loop_columns');
	add_filter('woocommerce_product_description_heading', 'cm_woo_custom_product_description_heading');
	add_filter('woocommerce_checkout_fields' , 'cm_woo_custom_override_checkout_fields');
	add_filter('woocommerce_show_page_title', 'cm_woo_custom_show_page_title');
	add_filter('loop_shop_per_page', 'cm_loop_shop_per_page', 20);
	add_filter('woocommerce_review_gravatar_size', 'cm_woo_custom_review_gravatar_size');
	add_filter('theme_page_templates', 'cm_woocommerce_page_templates' , 11, 3);
		
	//custom theme actions
	if(!function_exists('_wp_render_title_tag')) 
		add_action('wp_head', 'cm_theme_slug_render_title');
	add_action("add_meta_boxes", "cm_theme_add_ql_services_custom_box");
	add_action("save_post", "cm_theme_save_ql_services_postdata");
	add_action('widgets_init', 'cm_remove_search_widget');
	
	//custom theme woocommerce actions
	remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5);
	remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10);
	remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
	remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
	//remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20);
	add_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 5);
	add_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 10);
	add_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
	//add_action('woocommerce_after_shop_loop', 'woocommerce_result_count', 20);
	
	//phpMailer
	add_action('phpmailer_init', 'cm_phpmailer_init');
	
	//content width
	if(!isset($content_width)) 
		$content_width = 1170;
	
	//register sidebars
	if(function_exists("register_sidebar"))
	{
		//register custom sidebars
		$sidebars_list = get_posts(array( 
			'post_type' => 'cm_sidebars',
			'posts_per_page' => '-1',
			'post_status' => 'publish',
			'orderby' => 'menu_order',
			'order' => 'ASC'
		));
		foreach($sidebars_list as $sidebar)
		{
			$before_widget = get_post_meta($sidebar->ID, "before_widget", true);
			$after_widget = get_post_meta($sidebar->ID, "after_widget", true);
			$before_title = get_post_meta($sidebar->ID, "before_title", true);
			$after_title = get_post_meta($sidebar->ID, "after_title", true);
			register_sidebar(array(
				"id" => $sidebar->post_name,
				"name" => $sidebar->post_title,
				'before_widget' => ($before_widget!='' && $before_widget!='empty' ? $before_widget : ''),
				'after_widget' => ($after_widget!='' && $after_widget!='empty' ? $after_widget : ''),
				'before_title' => ($before_title!='' && $before_title!='empty' ? $before_title : ''),
				'after_title' => ($after_title!='' && $after_title!='empty' ? $after_title : '')
			));
		}
	}
}
add_action("after_setup_theme", "cm_theme_after_setup_theme");
function cm_theme_switch_theme($theme_template)
{
	delete_option("cm_installed");
}
add_action("switch_theme", "cm_theme_switch_theme");

/* --- phpMailer config --- */
function cm_phpmailer_init($mail) 
{
	global $theme_options;
	$mail->CharSet='UTF-8';

	$smtp = $theme_options["cf_smtp_host"];
	if(!empty($smtp))
	{
		$mail->IsSMTP();
		$mail->SMTPAuth = true; 
		//$mail->SMTPDebug = 2;
		$mail->Host = $theme_options["cf_smtp_host"];
		$mail->Username = $theme_options["cf_smtp_username"];
		$mail->Password = $theme_options["cf_smtp_password"];
		if((int)$theme_options["cf_smtp_port"]>0)
			$mail->Port = (int)$theme_options["cf_smtp_port"];
		$mail->SMTPSecure = $theme_options["cf_smtp_secure"];
	}
}

function cm_custom_template_for_vc() 
{
    $data = array();
    $data['name'] = __('Single Post Template', 'cleanmate');
    $data['weight'] = 0;
    $data['image_path'] = preg_replace( '/\s/', '%20', get_template_directory_uri() . '/admin/images/visual_composer/layout.png');
    $data['custom_class'] = 'custom_template_for_vc_custom_template';
    $data['content'] = <<<CONTENT
		[vc_row top_margin="page-margin-top-section" el_class="padding-bottom-100"][vc_column width="3/4"][single_post show_post_title="1" show_post_featured_image="1" show_post_excerpt="0" show_post_date="1" show_post_date_image="1" show_post_views="1" show_post_comments="1" show_post_author="1" show_post_categories="1" show_post_tags="0" show_post_tags_bottom="1" show_leave_reply_button="1"][comments show_comments_form="1" show_comments_list="1" top_margin="page-margin-top" el_class=""][/vc_column][vc_column type="cm-smart-column" width="1/4"][vc_wp_categories title="" options="count" el_class="clearfix"][ql_services type="icons_list" featured_image_bg="0" borders="0" items_per_page="-1" ids="365" headers="1" headers_links="1" headers_border="0" show_excerpt="1" show_icon="1" icons_links="1" icon_tick="0" read_more="1" class="gray" top_margin="page-margin-top"][box_header title="LATEST POSTS" type="h6" bottom_border="1" top_margin="page-margin-top"][blog_small cm_pagination="0" items_per_page="3" offset="0" order_by="date" show_post_title="1" show_post_date="1" show_post_views="0" el_class="margin-top-30"][box_header title="MOST POPULAR" type="h6" bottom_border="1" top_margin="page-margin-top"][blog_small cm_pagination="0" items_per_page="3" offset="0" order_by="views" show_post_title="1" show_post_date="0" show_post_views="1" el_class="margin-top-30"][box_header title="TEXT WIDGET" type="h6" bottom_border="1" top_margin="page-margin-top"][vc_wp_text el_class="margin-top-10"]What makes Cleanmate trusted above other cleaning service providers? When you combine higher standards, smarter strategies and <a href="#">superior quality</a> all in one package, the result is top notch.[/vc_wp_text][vc_wp_archives title=" ARCHIVES" options="count" el_class="full-width page-margin-top clearfix"][vc_wp_tagcloud title="TAGS" taxonomy="post_tag" el_class="page-margin-top clearfix"][/vc_column][/vc_row]
CONTENT;
    vc_add_default_templates($data);
	
	$data = array();
    $data['name'] = __('Blog Template', 'cleanmate');
    $data['weight'] = 0;
    $data['image_path'] = preg_replace( '/\s/', '%20', get_template_directory_uri() . '/admin/images/visual_composer/layout.png');
    $data['custom_class'] = 'custom_template_for_vc_custom_template';
    $data['content'] = <<<CONTENT
		[vc_row top_margin="page-margin-top-section" el_class="padding-bottom-100"][vc_column width="3/4"][blog cm_pagination="1" items_per_page="4" ids="-" category="-" author="-" order_by="date" show_post_title="1" show_post_excerpt="1" excerpt_length="350" read_more="1" show_post_categories="1" show_post_tags="0" show_post_author="1" show_post_date="1" show_post_date_image="1" show_post_views="1" show_post_comments="1" is_search_results="0"][/vc_column][vc_column type="cm-smart-column" width="1/4"][vc_wp_categories title="" options="count" el_class="clearfix"][ql_services type="icons_list" featured_image_bg="0" borders="0" items_per_page="-1" ids="365" headers="1" headers_links="1" headers_border="0" show_excerpt="1" show_icon="1" icons_links="1" icon_tick="0" read_more="1" class="gray" top_margin="page-margin-top"][box_header title="LATEST POSTS" type="h6" bottom_border="1" top_margin="page-margin-top"][blog_small cm_pagination="0" items_per_page="3" offset="0" order_by="date" show_post_title="1" show_post_date="1" show_post_views="0" el_class="margin-top-30"][box_header title="MOST POPULAR" type="h6" bottom_border="1" top_margin="page-margin-top"][blog_small cm_pagination="0" items_per_page="3" offset="0" order_by="views" show_post_title="1" show_post_date="0" show_post_views="1" el_class="margin-top-30"][box_header title="TEXT WIDGET" type="h6" bottom_border="1" top_margin="page-margin-top"][vc_wp_text el_class="margin-top-10"]What makes Cleanmate trusted above other cleaning service providers? When you combine higher standards, smarter strategies and <a href="#">superior quality</a> all in one package, the result is top notch.[/vc_wp_text][vc_wp_archives title=" ARCHIVES" options="count" el_class="full-width page-margin-top clearfix"][vc_wp_tagcloud title="TAGS" taxonomy="post_tag" el_class="page-margin-top clearfix"][/vc_column][/vc_row]
CONTENT;
    vc_add_default_templates($data);
	
	$data = array();
    $data['name'] = __('Search Template', 'cleanmate');
    $data['weight'] = 0;
    $data['image_path'] = preg_replace( '/\s/', '%20', get_template_directory_uri() . '/admin/images/visual_composer/layout.png');
    $data['custom_class'] = 'custom_template_for_vc_custom_template';
    $data['content'] = <<<CONTENT
		[vc_row top_margin="page-margin-top-section" el_class="padding-bottom-100"][vc_column width="3/4"][blog cm_pagination="1" items_per_page="4" ids="-" category="-" author="-" order_by="date" show_post_title="1" show_post_excerpt="1" excerpt_length="350" read_more="1" show_post_categories="1" show_post_tags="0" show_post_author="1" show_post_date="1" show_post_date_image="1" show_post_views="1" show_post_comments="1" is_search_results="1"][/vc_column][vc_column type="cm-smart-column" width="1/4"][vc_wp_categories title="" options="count" el_class="clearfix"][ql_services type="icons_list" featured_image_bg="0" borders="0" items_per_page="-1" ids="365" headers="1" headers_links="1" headers_border="0" show_excerpt="1" show_icon="1" icons_links="1" icon_tick="0" read_more="1" class="gray" top_margin="page-margin-top"][box_header title="LATEST POSTS" type="h6" bottom_border="1" top_margin="page-margin-top"][blog_small cm_pagination="0" items_per_page="3" offset="0" order_by="date" show_post_title="1" show_post_date="1" show_post_views="0" el_class="margin-top-30"][box_header title="MOST POPULAR" type="h6" bottom_border="1" top_margin="page-margin-top"][blog_small cm_pagination="0" items_per_page="3" offset="0" order_by="views" show_post_title="1" show_post_date="0" show_post_views="1" el_class="margin-top-30"][box_header title="TEXT WIDGET" type="h6" bottom_border="1" top_margin="page-margin-top"][vc_wp_text el_class="margin-top-10"]What makes Cleanmate trusted above other cleaning service providers? When you combine higher standards, smarter strategies and <a href="#">superior quality</a> all in one package, the result is top notch.[/vc_wp_text][vc_wp_archives title=" ARCHIVES" options="count" el_class="full-width page-margin-top clearfix"][vc_wp_tagcloud title="TAGS" taxonomy="post_tag" el_class="page-margin-top clearfix"][/vc_column][/vc_row]
CONTENT;
    vc_add_default_templates($data);
	
	$data = array();
    $data['name'] = __('Single Project Template', 'cleanmate');
    $data['weight'] = 0;
    $data['image_path'] = preg_replace( '/\s/', '%20', get_template_directory_uri() . '/admin/images/visual_composer/layout.png');
    $data['custom_class'] = 'custom_template_for_vc_custom_template';
    $data['content'] = <<<CONTENT
		[vc_row top_margin="page-margin-top-section" el_class="padding-bottom-100"][vc_column][single_project][/vc_column][/vc_row]
CONTENT;
    vc_add_default_templates($data);
	
	$data = array();
    $data['name'] = __('Single Service Template', 'cleanmate');
    $data['weight'] = 0;
    $data['image_path'] = preg_replace( '/\s/', '%20', get_template_directory_uri() . '/admin/images/visual_composer/layout.png');
    $data['custom_class'] = 'custom_template_for_vc_custom_template';
    $data['content'] = <<<CONTENT
		[vc_row top_margin="page-margin-top-section" el_class="padding-bottom-100"][vc_column width="1/4"][vc_wp_custommenu nav_menu="18" el_class="vertical-menu"][ql_services type="icons_list" featured_image_bg="0" borders="0" items_per_page="-1" ids="365" headers="1" headers_links="1" headers_border="0" show_excerpt="1" show_icon="1" icons_links="1" icon_tick="0" read_more="1" class="gray" top_margin="page-margin-top"][box_header title="DOWNLOAD" type="h6" bottom_border="1" top_margin="page-margin-top"][vc_btn type="action" icon="arrow-vertical-3" title="Brochure" url="#" extraclass="margin-top-30"][vc_btn type="action" icon="arrow-vertical-3" title="Summary" url="#" extraclass="margin-top-10"][/vc_column][vc_column width="3/4"][single_service][/vc_column][/vc_row]
CONTENT;
    vc_add_default_templates($data);
	
	$data = array();
    $data['name'] = __('Single Team Member Template', 'cleanmate');
    $data['weight'] = 0;
    $data['image_path'] = preg_replace( '/\s/', '%20', get_template_directory_uri() . '/admin/images/visual_composer/layout.png');
    $data['custom_class'] = 'custom_template_for_vc_custom_template';
    $data['content'] = <<<CONTENT
        [vc_row type="full-width" top_margin="page-margin-top-section"][vc_column][single_team][/vc_column][/vc_row]
CONTENT;
    vc_add_default_templates($data);
	
	$data = array();
    $data['name'] = __('Team Member Page Layout', 'cleanmate');
    $data['weight'] = 0;
    $data['image_path'] = preg_replace( '/\s/', '%20', get_template_directory_uri() . '/admin/images/visual_composer/layout.png');
    $data['custom_class'] = 'custom_template_for_vc_custom_template';
    $data['content'] = <<<CONTENT
		[vc_row el_class="gray mobile-paddings padding-bottom-36"][vc_column width="1/3"][team_member_box style="gray" headers="0" headers_links="0" headers_border="0" show_subtitle="0" show_excerpt="0" show_social_icons="1" show_featured_image="1" featured_image_links="0" class="padding-left-20"][/vc_column][vc_column width="1/3" el_class="margin-top-40 padding-left-right-20"][box_header title="KARISMA TARUDA" type="h2" bottom_border="0" class="align-left"][vc_column_text el_class="description margin-top-10"]Co-Founder, Office Manager[/vc_column_text][vc_column_text el_class="margin-top-14"]I'm very organized person. I know how to clean efficiently. I'm very detailed and won't leave until everything is spotless and sanitized. I have two kids and that taught me a lot. I have cleaned houses for over ten years.[/vc_column_text][vc_column_text]I will come in early and make a delicious breakfast, clean it up and start the laundry. I will fold, iron, hang and put everything away. I will detail your home, top to bottom and make it show-ready.[/vc_column_text][/vc_column][vc_column width="1/3" el_class="margin-top-42 padding-right-30 padding-left-10"][box_header title="PERSONAL INFO" bottom_border="0"][vc_raw_html]JTNDdGFibGUlMjBjbGFzcyUzRCUyMm1hcmdpbi10b3AtMzMlMjIlM0UlMEElMDklM0N0Ym9keSUzRSUwQSUwOSUwOSUzQ3RyJTNFJTBBJTA5JTA5JTA5JTNDdGQlM0VBZ2UlM0MlMkZ0ZCUzRSUwQSUwOSUwOSUwOSUzQ3RkJTNFMjYlMjBZZWFycyUzQyUyRnRkJTNFJTBBJTA5JTA5JTNDJTJGdHIlM0UlMEElMDklMDklM0N0ciUzRSUwQSUwOSUwOSUwOSUzQ3RkJTNFTGl2aW5nJTIwaW4lM0MlMkZ0ZCUzRSUwQSUwOSUwOSUwOSUzQ3RkJTNFVGVtcGElMkMlMjBBWiUzQyUyRnRkJTNFJTBBJTA5JTA5JTNDJTJGdHIlM0UlMEElMDklMDklM0N0ciUzRSUwQSUwOSUwOSUwOSUzQ3RkJTNFRXhwZXJpZW5jZSUzQyUyRnRkJTNFJTBBJTA5JTA5JTA5JTNDdGQlM0UyJTIwWWVhcnMlM0MlMkZ0ZCUzRSUwQSUwOSUwOSUzQyUyRnRyJTNFJTBBJTA5JTA5JTNDdHIlM0UlMEElMDklMDklMDklM0N0ZCUzRURyaXZpbmclMjBsaWNlbnNlJTNDJTJGdGQlM0UlMEElMDklMDklMDklM0N0ZCUzRVllcyUzQyUyRnRkJTNFJTBBJTA5JTA5JTNDJTJGdHIlM0UlMEElMDklMDklM0N0ciUzRSUwQSUwOSUwOSUwOSUzQ3RkJTNFSG91cmx5JTIwcmF0ZSUzQyUyRnRkJTNFJTBBJTA5JTA5JTA5JTNDdGQlM0UlMjQyMC4wMCUyMC0lMjAlMjQ1MC4wMCUzQyUyRnRkJTNFJTBBJTA5JTA5JTNDJTJGdHIlM0UlMEElMDklMDklM0N0ciUzRSUwQSUwOSUwOSUwOSUzQ3RkJTNFUGhvbmUlM0MlMkZ0ZCUzRSUwQSUwOSUwOSUwOSUzQ3RkJTNFJTNDYSUyMGhyZWYlM0QlMjJ0ZWwlM0E1MDUyNzIyNTUlMjIlM0U1MDUlMjAyNzIlMjAyNTUlM0MlMkZhJTNFJTNDJTJGdGQlM0UlMEElMDklMDklM0MlMkZ0ciUzRSUwQSUwOSUzQyUyRnRib2R5JTNFJTBBJTNDJTJGdGFibGUlM0UlMEE=[/vc_raw_html][/vc_column][/vc_row][vc_row el_class="margin-top-67 padding-bottom-96"][vc_column width="1/4"][featured_item icon="vacuum-cleaner" title="HOUSEKEEPING" title_link="0" icon_link="0"]I am trustworthy, dependable and pay excellent attention to detail. I've been cleaning houses for over ten years.[/featured_item][/vc_column][vc_column width="1/4"][featured_item icon="cooking-gloves" title="COOKING" title_link="0" icon_link="0"]I cook italian food especially well. I can prepare an homemade lasagna or any other food anytime in any kitchen.[/featured_item][/vc_column][vc_column width="1/4"][featured_item icon="baby-stroller" title="BABYSITTING" title_link="0" icon_link="0"]I have experience with newborns through teenagers. I have excellent checkable references.[/featured_item][/vc_column][vc_column width="1/4"][featured_item icon="gardening" title="GARDENING" title_link="0" icon_link="0"]Simple garden works like mowing the lawn, basic flower gardening, harvest vegetable and grocery shopping.[/featured_item][/vc_column][/vc_row][vc_row type="full-width" el_class="flex-box" css=".vc_custom_1506946665915{background-color: #f6f6f6 !important;}"][vc_column width="1/3" el_class="padding-bottom-96"][box_header title="MY DUTIES:" bottom_border="0" class="margin-top-89 padding-left-right-70"][items_list additembutton="" class="margin-top-20 padding-left-right-70"][item icon="tick-2"]Offer a different kind of services to families and professionals[/item][item icon="tick-2"]Deliver high quality and consistent services[/item][item icon="tick-2"]Use environmentall friendly cleaning products[/item][item icon="tick-2"]Provide stable jobs with resonable wages[/item][item icon="tick-2"]Concentrate our resources on maintaining standards[/item][item icon="tick-2"]Make you an extremely satisfied customer[/item][/items_list][/vc_column][vc_column width="1/3" css=".vc_custom_1510321584895{background-image: url(http://quanticalabs.com/wp_themes/cleanmate/files/2017/11/image_02.jpg?id=1125) !important;background-position: center !important;background-repeat: no-repeat !important;background-size: cover !important;}" el_class="cm-overlay padding-bottom-96"][box_header title="MY SKILLS:" bottom_border="0" class="white margin-top-89 padding-left-right-70"][items_list additembutton="" class="white margin-top-20 padding-left-right-70"][item icon="tick-2"]Professional cleaning and household maintenance[/item][item icon="tick-2"]Day care for children and eldery persons[/item][item icon="tick-2"]Good Managing one's own time[/item][item icon="tick-2"]Great knowledge of the English language[/item][item icon="tick-2"]Highly skilled in vacumming, sweeping and mopping[/item][item icon="tick-2"]Able to clean all fixtures and furniture safely[/item][/items_list][/vc_column][vc_column width="1/3" el_class="padding-bottom-100"][box_header title="Want to talk?" type="h2" bottom_border="0" class="font-weight-300 align-left padding-left-right-70 margin-top-89"][vc_raw_html el_class="padding-left-right-70"]JTNDaDIlMjBjbGFzcyUzRCUyMmdyZWVuJTIyJTNFUGxlYXNlJTIwY2FsbCUyMG5vdyUzQSUyMCUzQ2ElMjBocmVmJTNEJTIydGVsJTNBMjUwNzI1NzA1MiUyMiUzRTI1MCUyMDcyNSUyMDcwNTIlM0MlMkZhJTNFJTNDJTJGaDIlM0U=[/vc_raw_html][vc_column_text el_class="description margin-top-20 padding-left-right-70"]Need a special cleaning service? We are happy to fulfill every request in order to exceed your expectations.[/vc_column_text][vc_row_inner top_margin="page-margin-top" el_class="width-auto padding-left-right-70"][vc_column_inner][vc_btn title="Contact form" url="http://quanticalabs.com/wp_themes/cleanmate/contact/"][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row][vc_row el_class="margin-top-89"][vc_column][box_header title="MY EXPERIENCE" type="h2" bottom_border="1"][vc_column_text el_class="description align-center"]I am trustworthy, dependable and pay excellent attention to detail.
I've been cleaning houses for over ten years.[/vc_column_text][timeline_item layout="right" label="2015 - 2016" title="ANN WILBERG CLEANING" subtitle="MAID SERVICE" animations="1" el_class="margin-top-65 first"]Paetos dignissim at cursus elefeind norma arcu. Pellentesque accumsan est in tempus etos ullamcorper, sem quam suscipit lacus maecenas tortor cursus elefeind dignissim.[/timeline_item][timeline_item label="2013 - 2015" title="SERVICE MASTER CO." subtitle="SERVICE OPERATOR" animations="1"]Paetos dignissim at cursus elefeind norma arcu. Pellentesque accumsan est in tempus etos ullamcorper, sem quam suscipit lacus maecenas tortor cursus elefeind dignissim.[/timeline_item][timeline_item layout="right" label="2012 - 2013" title="STEAM CLEAN" subtitle="CLEANING TECHNICAN" animations="1" el_class="last"]Paetos dignissim at cursus elefeind norma arcu. Pellentesque accumsan est in tempus etos ullamcorper, sem quam suscipit lacus maecenas tortor cursus elefeind dignissim.[/timeline_item][/vc_column][/vc_row][vc_row type="full-width" top_margin="page-margin-top-section" css=".vc_custom_1507026825915{background-color: #f6f6f6 !important;}" el_class="padding-top-89 padding-bottom-100"][vc_column][vc_row_inner][vc_column_inner][box_header title="MEET OTHER MEMBERS" type="h2" bottom_border="1"][vc_column_text el_class="description align-center"]Our team is our most valuable resource. All of our cleaning technicians have earned professional
cleaner certification through maid training academy.[/vc_column_text][ql_team items_per_page="-1" order_by="menu_order" headers="1" headers_links="1" headers_border="0" show_subtitle="1" show_excerpt="1" show_social_icons="1" show_featured_image="1" featured_image_links="1" class="margin-top-65"][/vc_column_inner][/vc_row_inner][vc_row_inner el_class="align-center margin-top-65 padding-bottom-16"][vc_column_inner][vc_btn title="All our technicians" url="http://quanticalabs.com/wp_themes/cleanmate/our-team/"][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row]
CONTENT;
    vc_add_default_templates($data);
}
if(is_plugin_active("js_composer/js_composer.php") && function_exists("vc_set_default_editor_post_types"))
	add_action("vc_load_default_templates_action", "cm_custom_template_for_vc");

/* --- Theme Custom Filters & Actions Functions --- */
//add new mimes for upload dummy content files (code can be removed after dummy content import)
function cm_custom_upload_files($mimes) 
{
    $mimes = array_merge($mimes, array('xml' => 'application/xml'), array('json' => 'application/json'), array('zip' => 'application/zip'), array('gz' => 'application/x-gzip'), array('ico' => 'image/x-icon'));
    return $mimes;
}
function cm_theme_image_sizes($sizes)
{
	$addsizes = array(
		"blog-post-thumb" => __("Blog post thumbnail", 'cleanmate'),
		"large-thumb" => __("Large thumbnail", 'cleanmate'),
		"big-thumb" => __("Big thumbnail", 'cleanmate'),
		"medium-thumb" => __("Medium thumbnail", 'cleanmate'),
		"medium-rectangle-thumb" => __("Medium rectangle thumbnail", 'cleanmate'),
		"medium-square-thumb" => __("Medium square thumbnail", 'cleanmate'),
		"small-thumb" => __("Small thumbnail", 'cleanmate'),
		"small-square-thumb" => __("Small square thumbnail", 'cleanmate'),
		"tiny-thumb" => __("Tiny thumbnail", 'cleanmate'),
	);
	$newsizes = array_merge($sizes, $addsizes);
	return $newsizes;
}
function cm_category_count_span($links) 
{
	$links = str_replace('</a> (', '<span>', $links);
	$links = str_replace('</a> <span class="count">(', '<span>', $links);
	$links = str_replace(')</span>', '</span></a>', $links);
	$links = str_replace(')', '</span></a>', $links);
	return $links;
}
function cm_archive_count_span($links) 
{
	if(strpos($links, "option")===false)
	{
		$links = str_replace('</a>&nbsp;(', '<span>', $links);
		$links = str_replace(')', '</span></a>', $links);
	}
	return $links;
}
//excerpt
function cm_theme_excerpt_more($more) 
{
	return '';
}
//sticky
function cm_check_image($class) 
{
	if(is_sticky())
		$class[] = 'sticky';
	return $class;
}
//user info
function cm_contactmethods($contactmethods) 
{
	$contactmethods['twitter'] = 'Twitter';
	$contactmethods['facebook'] = 'Facebook';
	$contactmethods['linkedin'] = 'Linkedin';
	$contactmethods['skype'] = 'Skype';
	$contactmethods['googleplus'] = 'Google Plus';
	$contactmethods['instagram'] = 'Instagram';
	return $contactmethods;
}
if(!function_exists('_wp_render_title_tag')) 
{
    function cm_theme_slug_render_title() 
	{
		echo ''. wp_title('-', true, 'right') . '';
    }
}
function cm_wp_title_filter($title, $sep)
{
	return $title;
}
function cm_filter_update_vc_plugin($date) 
{
    if(!empty($date->checked["js_composer/js_composer.php"]))
        unset($date->checked["js_composer/js_composer.php"]);
    if(!empty($date->response["js_composer/js_composer.php"]))
        unset($date->response["js_composer/js_composer.php"]);
    return $date;
}

//Adds a box to the main column on the Services edit screens
function cm_theme_add_ql_services_custom_box() 
{
	add_meta_box( 
        "ql_services_config",
        __("Options", 'cleanmate'),
        "cm_theme_inner_ql_services_custom_box_main",
        "ql_services",
		"side",
		"core"
    );
}

function cm_theme_inner_ql_services_custom_box_main($post)
{
	//Use nonce for verification
	wp_nonce_field(plugin_basename( __FILE__ ), "cm_ql_services_noncename");
	
	//The actual fields for data entry
	$icon = get_post_meta($post->ID, "icon", true);
	$custom_url = get_post_meta($post->ID, "ql_services_custom_url", true);
	echo '
	<table>
		<tr>
			<td>
				<label for="icon">' . __('Icon', 'cleanmate') . ':</label>
			</td>
			<td>
				<select style="width: 120px;" id="ql_services_icon" name="ql_services_icon">
					<option value="-"' . (empty($icon) || $icon=="-" ? ' selected="selected"' : '') . '>' . __('none', 'cleanmate') . '</option>
					<option class="features-armchair" value="features-armchair"' . ($icon=="features-armchair" ? ' selected="selected"' : '') . '>' . __('armchair', 'cleanmate') . '</option>
					<option class="features-baby-stroller" value="features-stroller"' . ($icon=="features-baby-stroller" ? ' selected="selected"' : '') . '>' . __('baby-stroller', 'cleanmate') . '</option>
					<option class="features-bag" value="features-bag"' . ($icon=="features-bag" ? ' selected="selected"' : '') . '>' . __('bag', 'cleanmate') . '</option>
					<option class="features-bank" value="features-bank"' . ($icon=="features-bank" ? ' selected="selected"' : '') . '>' . __('bank', 'cleanmate') . '</option>
					<option class="features-barn" value="features-barn"' . ($icon=="features-barn" ? ' selected="selected"' : '') . '>' . __('barn', 'cleanmate') . '</option>
					<option class="features-bath-tub" value="features-bath-tub"' . ($icon=="features-bath-tub" ? ' selected="selected"' : '') . '>' . __('bath-tub', 'cleanmate') . '</option>
					<option class="features-bathroom" value="features-bathroom"' . ($icon=="features-bathroom" ? ' selected="selected"' : '') . '>' . __('bathroom', 'cleanmate') . '</option>
					<option class="features-bedroom" value="features-bedroom"' . ($icon=="features-bedroom" ? ' selected="selected"' : '') . '>' . __('bedroom', 'cleanmate') . '</option>
					<option class="features-bellboy" value="features-bellboy"' . ($icon=="features-bellboy" ? ' selected="selected"' : '') . '>' . __('bellboy', 'cleanmate') . '</option>
					<option class="features-box" value="features-box"' . ($icon=="features-box" ? ' selected="selected"' : '') . '>' . __('box', 'cleanmate') . '</option>
					<option class="features-bubble" value="features-bubble"' . ($icon=="features-bubble" ? ' selected="selected"' : '') . '>' . __('bubble', 'cleanmate') . '</option>
					<option class="features-bucket" value="features-bucket"' . ($icon=="features-bucket" ? ' selected="selected"' : '') . '>' . __('bucket', 'cleanmate') . '</option>
					<option class="features-businessman" value="features-businessman"' . ($icon=="features-businessman" ? ' selected="selected"' : '') . '>' . __('businessman', 'cleanmate') . '</option>
					<option class="features-calculator" value="features-calculator"' . ($icon=="features-calculator" ? ' selected="selected"' : '') . '>' . __('calculator', 'cleanmate') . '</option>
					<option class="features-call" value="features-call"' . ($icon=="features-call" ? ' selected="selected"' : '') . '>' . __('call', 'cleanmate') . '</option>
					<option class="features-car" value="features-car"' . ($icon=="features-car" ? ' selected="selected"' : '') . '>' . __('car', 'cleanmate') . '</option>
					<option class="features-carwash" value="features-carwash"' . ($icon=="features-carwash" ? ' selected="selected"' : '') . '>' . __('carwash', 'cleanmate') . '</option>
					<option class="features-cat" value="features-cat"' . ($icon=="features-cat" ? ' selected="selected"' : '') . '>' . __('cat', 'cleanmate') . '</option>
					<option class="features-cc-camera" value="features-cc-camera"' . ($icon=="features-cc-camera" ? ' selected="selected"' : '') . '>' . __('cc-camera', 'cleanmate') . '</option>
					<option class="features-chat" value="features-chat"' . ($icon=="features-chat" ? ' selected="selected"' : '') . '>' . __('chat', 'cleanmate') . '</option>
					<option class="features-check" value="features-check"' . ($icon=="features-check" ? ' selected="selected"' : '') . '>' . __('check', 'cleanmate') . '</option>
					<option class="features-chef-hat" value="features-chef-hat"' . ($icon=="features-chef-hat" ? ' selected="selected"' : '') . '>' . __('chef-hat', 'cleanmate') . '</option>
					<option class="features-click" value="features-click"' . ($icon=="features-click" ? ' selected="selected"' : '') . '>' . __('click', 'cleanmate') . '</option>
					<option class="features-clock" value="features-clock"' . ($icon=="features-clock" ? ' selected="selected"' : '') . '>' . __('clock', 'cleanmate') . '</option>
					<option class="features-cloth" value="features-cloth"' . ($icon=="features-cloth" ? ' selected="selected"' : '') . '>' . __('cloth', 'cleanmate') . '</option>
					<option class="features-construction" value="features-construction"' . ($icon=="features-construction" ? ' selected="selected"' : '') . '>' . __('construction', 'cleanmate') . '</option>
					<option class="features-cooking" value="features-cooking"' . ($icon=="features-cooking" ? ' selected="selected"' : '') . '>' . __('cooking', 'cleanmate') . '</option>
					<option class="features-cooking-gloves" value="features-cooking-gloves"' . ($icon=="features-cooking-gloves" ? ' selected="selected"' : '') . '>' . __('cooking-gloves', 'cleanmate') . '</option>
					<option class="features-credit-card" value="features-credit-card"' . ($icon=="features-credit-card" ? ' selected="selected"' : '') . '>' . __('credit-card', 'cleanmate') . '</option>
					<option class="features-cupboard" value="features-cupboard"' . ($icon=="features-cupboard" ? ' selected="selected"' : '') . '>' . __('cupboard', 'cleanmate') . '</option>
					<option class="features-delivery" value="features-delivery"' . ($icon=="features-delivery" ? ' selected="selected"' : '') . '>' . __('delivery', 'cleanmate') . '</option>
					<option class="features-diamond" value="features-diamond"' . ($icon=="features-diamond" ? ' selected="selected"' : '') . '>' . __('diamond', 'cleanmate') . '</option>
					<option class="features-eco" value="features-eco"' . ($icon=="features-eco" ? ' selected="selected"' : '') . '>' . __('eco', 'cleanmate') . '</option>
					<option class="features-email" value="features-email"' . ($icon=="features-email" ? ' selected="selected"' : '') . '>' . __('email', 'cleanmate') . '</option>
					<option class="features-factory" value="features-factory"' . ($icon=="features-factory" ? ' selected="selected"' : '') . '>' . __('factory', 'cleanmate') . '</option>
					<option class="features-flower" value="features-flower"' . ($icon=="features-flower" ? ' selected="selected"' : '') . '>' . __('flower', 'cleanmate') . '</option>
					<option class="features-food" value="features-food"' . ($icon=="features-food" ? ' selected="selected"' : '') . '>' . __('food', 'cleanmate') . '</option>
					<option class="features-gardening" value="features-gardening"' . ($icon=="features-gardening" ? ' selected="selected"' : '') . '>' . __('gardening', 'cleanmate') . '</option>
					<option class="features-gift" value="features-gift"' . ($icon=="features-gift" ? ' selected="selected"' : '') . '>' . __('gift', 'cleanmate') . '</option>
					<option class="features-home-1" value="features-home-1"' . ($icon=="features-home-1" ? ' selected="selected"' : '') . '>' . __('home-1', 'cleanmate') . '</option>
					<option class="features-home-2" value="features-home-2"' . ($icon=="features-home-2" ? ' selected="selected"' : '') . '>' . __('home-2', 'cleanmate') . '</option>
					<option class="features-home-3" value="features-home-3"' . ($icon=="features-home-3" ? ' selected="selected"' : '') . '>' . __('home-3', 'cleanmate') . '</option>
					<option class="features-home-4" value="features-home-4"' . ($icon=="features-home-4" ? ' selected="selected"' : '') . '>' . __('home-4', 'cleanmate') . '</option>
					<option class="features-home-5" value="features-home-5"' . ($icon=="features-home-5" ? ' selected="selected"' : '') . '>' . __('home-5', 'cleanmate') . '</option>
					<option class="features-image" value="features-image"' . ($icon=="features-image" ? ' selected="selected"' : '') . '>' . __('image', 'cleanmate') . '</option>
					<option class="features-key" value="features-key"' . ($icon=="features-key" ? ' selected="selected"' : '') . '>' . __('key', 'cleanmate') . '</option>
					<option class="features-lady" value="features-lady"' . ($icon=="features-lady" ? ' selected="selected"' : '') . '>' . __('lady', 'cleanmate') . '</option>
					<option class="features-lamp" value="features-lamp"' . ($icon=="features-lamp" ? ' selected="selected"' : '') . '>' . __('lamp', 'cleanmate') . '</option>
					<option class="features-lamp-cabinet" value="features-lamp-cabinet"' . ($icon=="features-lamp-cabinet" ? ' selected="selected"' : '') . '>' . __('lamp-cabinet', 'cleanmate') . '</option>
					<option class="features-leaf" value="features-leaf"' . ($icon=="features-leaf" ? ' selected="selected"' : '') . '>' . __('leaf', 'cleanmate') . '</option>
					<option class="features-location-1" value="features-location-1"' . ($icon=="features-location-1" ? ' selected="selected"' : '') . '>' . __('location-1', 'cleanmate') . '</option>
					<option class="features-location-2" value="features-location-2"' . ($icon=="features-location-2" ? ' selected="selected"' : '') . '>' . __('location-2', 'cleanmate') . '</option>
					<option class="features-lock" value="features-lock"' . ($icon=="features-lock" ? ' selected="selected"' : '') . '>' . __('lock', 'cleanmate') . '</option>
					<option class="features-maid" value="features-maid"' . ($icon=="features-maid" ? ' selected="selected"' : '') . '>' . __('maid', 'cleanmate') . '</option>
					<option class="features-man" value="features-man"' . ($icon=="features-man" ? ' selected="selected"' : '') . '>' . __('man', 'cleanmate') . '</option>
					<option class="features-map" value="features-map"' . ($icon=="features-map" ? ' selected="selected"' : '') . '>' . __('map', 'cleanmate') . '</option>
					<option class="features-megaphone" value="features-megaphone"' . ($icon=="features-megaphone" ? ' selected="selected"' : '') . '>' . __('megaphone', 'cleanmate') . '</option>
					<option class="features-office-1" value="features-office-1"' . ($icon=="features-office-1" ? ' selected="selected"' : '') . '>' . __('office-1', 'cleanmate') . '</option>
					<option class="features-office-2" value="features-office-2"' . ($icon=="features-office-2" ? ' selected="selected"' : '') . '>' . __('office-2', 'cleanmate') . '</option>
					<option class="features-operator" value="features-operator"' . ($icon=="features-operator" ? ' selected="selected"' : '') . '>' . __('operator', 'cleanmate') . '</option>
					<option class="features-paint" value="features-paint"' . ($icon=="features-paint" ? ' selected="selected"' : '') . '>' . __('paint', 'cleanmate') . '</option>
					<option class="features-paintroll" value="features-paintroll"' . ($icon=="features-paintroll" ? ' selected="selected"' : '') . '>' . __('paintroll', 'cleanmate') . '</option>
					<option class="features-person" value="features-person"' . ($icon=="features-person" ? ' selected="selected"' : '') . '>' . __('person', 'cleanmate') . '</option>
					<option class="features-pet" value="features-pet"' . ($icon=="features-pet" ? ' selected="selected"' : '') . '>' . __('pet', 'cleanmate') . '</option>
					<option class="features-pet-tray" value="features-pet-tray"' . ($icon=="features-pet-tray" ? ' selected="selected"' : '') . '>' . __('pet-tray', 'cleanmate') . '</option>
					<option class="features-phone" value="features-phone"' . ($icon=="features-phone" ? ' selected="selected"' : '') . '>' . __('phone', 'cleanmate') . '</option>
					<option class="features-picture" value="features-picture"' . ($icon=="features-picture" ? ' selected="selected"' : '') . '>' . __('picture', 'cleanmate') . '</option>
					<option class="features-pin" value="features-pin"' . ($icon=="features-pin" ? ' selected="selected"' : '') . '>' . __('pin', 'cleanmate') . '</option>
					<option class="features-plant" value="features-plant"' . ($icon=="features-plant" ? ' selected="selected"' : '') . '>' . __('plant', 'cleanmate') . '</option>
					<option class="features-recurring" value="features-recurring"' . ($icon=="features-recurring" ? ' selected="selected"' : '') . '>' . __('recurring', 'cleanmate') . '</option>
					<option class="features-recycle" value="features-recycle"' . ($icon=="features-recycle" ? ' selected="selected"' : '') . '>' . __('recycle', 'cleanmate') . '</option>
					<option class="features-shirt-1" value="features-shirt-1"' . ($icon=="features-shirt-1" ? ' selected="selected"' : '') . '>' . __('shirt-1', 'cleanmate') . '</option>
					<option class="features-shirt-2" value="features-shirt-2"' . ($icon=="features-shirt-2" ? ' selected="selected"' : '') . '>' . __('shirt-2', 'cleanmate') . '</option>
					<option class="features-spa-1" value="features-spa-1"' . ($icon=="features-spa-1" ? ' selected="selected"' : '') . '>' . __('spa-1', 'cleanmate') . '</option>
					<option class="features-spa-2" value="features-spa-2"' . ($icon=="features-spa-2" ? ' selected="selected"' : '') . '>' . __('spa-2', 'cleanmate') . '</option>
					<option class="features-spray" value="features-spray"' . ($icon=="features-spray" ? ' selected="selected"' : '') . '>' . __('spray', 'cleanmate') . '</option>
					<option class="features-spray-bottle" value="features-spray-bottle"' . ($icon=="features-spray-bottle" ? ' selected="selected"' : '') . '>' . __('spray-bottle', 'cleanmate') . '</option>
					<option class="features-store" value="features-store"' . ($icon=="features-store" ? ' selected="selected"' : '') . '>' . __('store', 'cleanmate') . '</option>
					<option class="features-support" value="features-support"' . ($icon=="features-support" ? ' selected="selected"' : '') . '>' . __('support', 'cleanmate') . '</option>
					<option class="features-task" value="features-task"' . ($icon=="features-task" ? ' selected="selected"' : '') . '>' . __('task', 'cleanmate') . '</option>
					<option class="features-team" value="features-team"' . ($icon=="features-team" ? ' selected="selected"' : '') . '>' . __('team', 'cleanmate') . '</option>
					<option class="features-time" value="features-time"' . ($icon=="features-time" ? ' selected="selected"' : '') . '>' . __('time', 'cleanmate') . '</option>
					<option class="features-toilet" value="features-toilet"' . ($icon=="features-toilet" ? ' selected="selected"' : '') . '>' . __('toilet', 'cleanmate') . '</option>
					<option class="features-toilet-sink" value="features-toilet-sink"' . ($icon=="features-toilet-sink" ? ' selected="selected"' : '') . '>' . __('toilet-sink', 'cleanmate') . '</option>
					<option class="features-toolbox" value="features-toolbox"' . ($icon=="features-toolbox" ? ' selected="selected"' : '') . '>' . __('toolbox', 'cleanmate') . '</option>
					<option class="features-trolley" value="features-trolley"' . ($icon=="features-trolley" ? ' selected="selected"' : '') . '>' . __('trolley', 'cleanmate') . '</option>
					<option class="features-umbrella" value="features-umbrella"' . ($icon=="features-umbrella" ? ' selected="selected"' : '') . '>' . __('umbrella', 'cleanmate') . '</option>
					<option class="features-vacuum-cleaner" value="features-vacuum-cleaner"' . ($icon=="features-vacuum-cleaner" ? ' selected="selected"' : '') . '>' . __('vacuum-cleaner', 'cleanmate') . '</option>
					<option class="features-video" value="features-video"' . ($icon=="features-video" ? ' selected="selected"' : '') . '>' . __('video', 'cleanmate') . '</option>
					<option class="features-wallet" value="features-wallet"' . ($icon=="features-wallet" ? ' selected="selected"' : '') . '>' . __('wallet', 'cleanmate') . '</option>
					<option class="features-washing-machine" value="features-washing-machine"' . ($icon=="features-washing-machine" ? ' selected="selected"' : '') . '>' . __('washing-machine', 'cleanmate') . '</option>
					<option class="features-water" value="features-water"' . ($icon=="features-water" ? ' selected="selected"' : '') . '>' . __('water', 'cleanmate') . '</option>
					<option class="features-watering-can" value="features-watering-can"' . ($icon=="features-watering-can" ? ' selected="selected"' : '') . '>' . __('watering-can', 'cleanmate') . '</option>
					<option class="features-wrench" value="features-wrench"' . ($icon=="features-wrench" ? ' selected="selected"' : '') . '>' . __('wrench', 'cleanmate') . '</option>
				</select>
			</td>
		</tr>
		<tr>
			<td>
				<label>' . __('Custom url:', 'cleanmate') . '</label>
			</td>
			<td>
				<input class="regular-text" type="text" id="ql_services_custom_url" name="ql_services_custom_url" value="' . (!empty($custom_url) ? esc_attr($custom_url) : '') . '">
			</td>
		</tr>
	</table>';
}

//When the post is saved, saves our custom data
function cm_theme_save_ql_services_postdata($post_id) 
{
	//verify if this is an auto save routine. 
	//if it is our form has not been submitted, so we dont want to do anything
	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) 
		return;

	//verify this came from the our screen and with proper authorization,
	//because save_post can be triggered at other times
	if (!isset($_POST['cm_ql_services_noncename']) || !wp_verify_nonce($_POST['cm_ql_services_noncename'], plugin_basename( __FILE__ )))
		return;


	//Check permissions
	if(!current_user_can('edit_post', $post_id))
		return;

	//OK, we're authenticated: we need to find and save the data
	update_post_meta($post_id, "icon", $_POST["ql_services_icon"]);
	update_post_meta($post_id, "ql_services_custom_url", $_POST["ql_services_custom_url"]);
}

function cm_remove_search_widget()
{
	//unregister_widget('WP_Widget_Search');
}

/* --- Theme WooCommerce Custom Filters Functions --- */
function cm_woo_custom_override_pagination_args($args) 
{
	$args['prev_text'] = __('&lsaquo;', 'cleanmate');
	$args['next_text'] = __('&rsaquo;', 'cleanmate');
	return $args;
}
function cm_woo_custom_cart_button_text() 
{
	return __('Add to cart', 'cleanmate');
}
if(!function_exists('loop_columns')) 
{
	function cm_woo_custom_loop_columns() 
	{
		return 3; // 3 products per row
	}
}
function cm_woo_custom_product_description_heading() 
{
    return '';
}
function cm_woo_custom_show_page_title()
{
	return false;
}
function cm_loop_shop_per_page($cols)
{
	return 9;
}
function cm_woo_custom_override_checkout_fields($fields) 
{
	$fields['billing']['billing_first_name']['placeholder'] = __("First Name", 'cleanmate');
	$fields['billing']['billing_last_name']['placeholder'] = __("Last Name", 'cleanmate');
	$fields['billing']['billing_company']['placeholder'] = __("Company Name", 'cleanmate');
	$fields['billing']['billing_email']['placeholder'] = __("Email Address", 'cleanmate');
	$fields['billing']['billing_phone']['placeholder'] = __("Phone", 'cleanmate');
	return $fields;
}
function cm_woo_custom_review_gravatar_size()
{
	return 100;
}

function cm_woocommerce_page_templates($page_templates, $class, $post)
{
	if(is_plugin_active('woocommerce/woocommerce.php'))
	{
		$shop_page_id = wc_get_page_id('shop');
		if($post && absint($shop_page_id) === absint($post->ID))
		{
			$page_templates["path-to-template/full-width.php"] = "Template Name";
		}
	}
 	return $page_templates;
}

//admin functions
cm_get_theme_file("/admin/functions.php");

//theme options
global $theme_options;
$theme_options = array(
	"favicon_url" => '',
	"logo_url" => '',
	"alternative_logo_url" => '',
	"logo_retina_url" => '',
	"alternative_logo_retina_url" => '',
	"logo_text" => '',
	"footer_text" => '',
	"sticky_menu" => '',
	"responsive" => '',
	"scroll_top" => '',
	"layout" => '',
	"layout_style" => '',
	"layout_image_overlay" => '',
	"style_selector" => '',
	"direction" => '',
	"collapsible_mobile_submenus" => '',
	"google_api_code" => '',
	"google_recaptcha" => '',
	"google_recaptcha_comments" => '',
	"recaptcha_site_key" => '',
	"recaptcha_secret_key" => '',
	"ga_tracking_code" => '',
	"cf_admin_name" => '',
	"cf_admin_email" => '',
	"cf_smtp_host" => '',
	"cf_smtp_username" => '',
	"cf_smtp_password" => '',
	"cf_smtp_port" => '',
	"cf_smtp_secure" => '',
	"cf_email_subject" => '',
	"cf_template" => '',
	"cf_name_message" => '',
	"cf_email_message" => '',
	"cf_phone_message" => '',
	"cf_message_message" => '',
	"cf_recaptcha_message" => '',
	"cf_terms_message" => '',
	"cf_thankyou_message" => '',
	"cf_error_message" => '',
	"cf_name_message_comments" => '',
	"cf_email_message_comments" => '',
	"cf_comment_message_comments" => '',
	"cf_recaptcha_message_comments" => '',
	"cf_terms_message_comments" => '',
	"cf_thankyou_message_comments" => '',
	"cf_error_message_comments" => '',
	"site_background_color" => '',
	"main_color" => '',
	"header_type" => '',
	"header_top_sidebar" => '',
	"header_menu_sidebar" => '',
	"primary_font" => '',
	"primary_font_subset" => '',
	"primary_font_custom" => '',
	"secondary_font" => '',
	"secondary_font_subset" => '',
	"secondary_font_custom" => ''
);
$theme_options = cm_theme_stripslashes_deep(array_merge($theme_options, (array)get_option("cm_options")));

function cm_theme_enqueue_scripts()
{
	global $themename;
	global $theme_options;
	//style
	if($theme_options["primary_font"]!="" && $theme_options["primary_font_custom"]=="")
		wp_enqueue_style("google-font-primary", "//fonts.googleapis.com/css?family=" . urlencode($theme_options["primary_font"]) . (!empty($theme_options["primary_font_subset"]) ? "&subset=" . implode(",", $theme_options["primary_font_subset"]) : ""));
	else if($theme_options["primary_font_custom"]=="")
		wp_enqueue_style("google-font-raleway", "//fonts.googleapis.com/css?family=Raleway:300,400,500&amp;subset=latin-ext");
	if($theme_options["secondary_font"]!="" && $theme_options["secondary_font_custom"]=="")
		wp_enqueue_style("google-font-secondary", "//fonts.googleapis.com/css?family=" . urlencode($theme_options["secondary_font"]) . (!empty($theme_options["secondary_font_subset"]) ? "&subset=" . implode(",", $theme_options["secondary_font_subset"]) : ""));
	else if($theme_options["secondary_font_custom"]=="")
		wp_enqueue_style("google-font-lato", "//fonts.googleapis.com/css?family=Lato:300,400,700,900&amp;subset=latin-ext");
	wp_enqueue_style("reset", get_template_directory_uri() . "/style/reset.css");
	wp_enqueue_style("superfish", get_template_directory_uri() ."/style/superfish.css");
	wp_enqueue_style("prettyPhoto", get_template_directory_uri() ."/style/prettyPhoto.css");
	wp_enqueue_style("jquery-qtip", get_template_directory_uri() ."/style/jquery.qtip.css");
	wp_enqueue_style("odometer", get_template_directory_uri() ."/style/odometer-theme-default.css");
	wp_enqueue_style("animations", get_template_directory_uri() ."/style/animations.css");
	wp_enqueue_style("main-style", get_stylesheet_uri());
	if((int)$theme_options["responsive"])
		wp_enqueue_style("responsive", get_template_directory_uri() ."/style/responsive.css");
	else
		wp_enqueue_style("no-responsive", get_template_directory_uri() ."/style/no_responsive.css");

	if(is_plugin_active('woocommerce/woocommerce.php'))
	{
		wp_enqueue_style("woocommerce-custom", get_template_directory_uri() ."/woocommerce/style.css");
		if((int)$theme_options["responsive"])
			wp_enqueue_style("woocommerce-responsive", get_template_directory_uri() ."/woocommerce/responsive.css");
		else
			wp_dequeue_style("woocommerce-smallscreen");
		if(is_rtl())
			wp_enqueue_style("woocommerce-rtl", get_template_directory_uri() ."/woocommerce/rtl.css");
	}
	wp_enqueue_style("cm-features", get_template_directory_uri() ."/fonts/features/style.css");
	wp_enqueue_style("cm-template", get_template_directory_uri() ."/fonts/template/style.css");
	wp_enqueue_style("cm-social", get_template_directory_uri() ."/fonts/social/style.css");
	wp_enqueue_style("custom", get_template_directory_uri() ."/custom.css");
	$main_color = (isset($_COOKIE['cm_main_color']) ? $_COOKIE['cm_main_color'] : $theme_options['main_color']);
	if($theme_options["site_background_color"]!="" || $main_color!="" || $theme_options["primary_font_custom"]!="" || $theme_options["primary_font"]!="")
	{
		ob_start();
		cm_get_theme_file("/custom_colors.php");
		$custom_colors_css = ob_get_clean();
		wp_add_inline_style("custom", $custom_colors_css);
	}
	//js
	wp_enqueue_script("jquery-ui-core", false, array("jquery"), false, true);
	wp_enqueue_script("jquery-ui-accordion", false, array("jquery"), false, true);
	wp_enqueue_script("jquery-ui-tabs", false, array("jquery"), false, true);
	wp_enqueue_script("jquery-ui-datepicker", false, array("jquery"), false, true);
	wp_enqueue_script("jquery-ui-selectmenu", false, array("jquery"), false, true);
	wp_enqueue_script("jquery-ui-slider", false, array("jquery"), false, true);
	wp_enqueue_script("jquery-ui-touch-punch", get_template_directory_uri() ."/js/jquery.ui.touch-punch.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-imagesloaded", get_template_directory_uri() . "/js/jquery.imagesloaded-packed.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-isotope", get_template_directory_uri() . "/js/jquery.isotope-packed.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-ba-bqq", get_template_directory_uri() ."/js/jquery.ba-bbq.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-easing", get_template_directory_uri() ."/js/jquery.easing.1.4.1.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-carouFredSel", get_template_directory_uri() ."/js/jquery.carouFredSel-6.2.1-packed.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-touchSwipe", get_template_directory_uri() ."/js/jquery.touchSwipe.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-transit", get_template_directory_uri() ."/js/jquery.transit.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-timeago", get_template_directory_uri() ."/js/jquery.timeago.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-hint", get_template_directory_uri() ."/js/jquery.hint.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-qtip", get_template_directory_uri() ."/js/jquery.qtip.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-block-ui", get_template_directory_uri() ."/js/jquery.blockUI.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-prettyPhoto", get_template_directory_uri() ."/js/jquery.prettyPhoto.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-parallax", get_template_directory_uri() ."/js/jquery.parallax.min.js", array("jquery"), false, true);
	wp_enqueue_script("jquery-odometer", get_template_directory_uri() ."/js/odometer.min.js", array("jquery", "theme-main" ), false, true);
	wp_register_script("google-maps-v3", "//maps.google.com/maps/api/js" . ($theme_options["google_api_code"]!="" ? "?key=" . esc_attr($theme_options["google_api_code"]) : ""), array(), false, true);
	wp_register_script("google-recaptcha-v2", "https://google.com/recaptcha/api.js", array(), false, true);
	if(function_exists("is_customize_preview") && !is_customize_preview())
		wp_enqueue_script("theme-main", get_template_directory_uri() ."/js/main.js", array("jquery", "jquery-ui-core", "jquery-ui-accordion", "jquery-ui-tabs"), false, true);
	if(!empty($theme_options['ga_tracking_code']))
	{
		$inline_script = $theme_options['ga_tracking_code'];
		wp_add_inline_script("jquery", $inline_script);
	}
	//ajaxurl
	$data["ajaxurl"] = admin_url("admin-ajax.php");
	//themename
	$data["themename"] = $themename;
	//home url
	$data["home_url"] = esc_url(get_home_url());
	//cart url
	if(is_plugin_active('woocommerce/woocommerce.php'))
	{
		$data["cart_url"] = wc_get_cart_url();
	}
	//is_rtl
	$data["is_rtl"] = ((is_rtl() || $theme_options["direction"]=='rtl') && ((isset($_COOKIE["cm_direction"]) && $_COOKIE["cm_direction"]!="LTR") || !isset($_COOKIE["cm_direction"]))) || (isset($_COOKIE["cm_direction"]) && $_COOKIE["cm_direction"]=="RTL") ? 1 : 0;
	
	//pass data to javascript
	$params = array(
		'l10n_print_after' => 'config = ' . json_encode($data) . ';'
	);
	wp_localize_script("theme-main", "config", $params);
}
add_action("wp_enqueue_scripts", "cm_theme_enqueue_scripts", 12);

//function to display number of posts
function cm_getPostViews($postID)
{
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count=='')
	{
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
    }
    return (int)$count;
}

//function to count views
function cm_setPostViews($postID) 
{
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count=='')
	{
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, 1);
    }
	else
	{
        $count++;
        update_post_meta($postID, $count_key, $count);
    }
}

function cm_get_time_iso8601() 
{
	$offset = get_option('gmt_offset');
	$timezone = ($offset < 0 ? '-' : '+') . (abs($offset)<10 ? '0'.abs($offset) : abs($offset)) . '00' ;
	return get_the_time('Y-m-d\TH:i:s') . $timezone;					
}

function cm_theme_direction() 
{
	global $wp_locale, $theme_options;
	if(isset($theme_options['direction']) || (isset($_COOKIE["cm_direction"]) && ($_COOKIE["cm_direction"]=="LTR" || $_COOKIE["cm_direction"]=="RTL")))
	{
		if($theme_options['direction']=='default' && empty($_COOKIE["cm_direction"]))
			return;
		$wp_locale->text_direction = ((!empty($theme_options['direction']) && $theme_options['direction']=='rtl') && (empty($_COOKIE["cm_direction"]) || $_COOKIE["cm_direction"]!="LTR")) || (!empty($_COOKIE["cm_direction"]) && $_COOKIE["cm_direction"]=="RTL") ? 'rtl' : 'ltr';
	}
}
add_action("after_setup_theme", "cm_theme_direction");

function cm_get_theme_file($file)
{
	if(file_exists(get_stylesheet_directory() . $file))
        require_once(get_stylesheet_directory() . $file);
    else
        require_once(get_template_directory() . $file);
}

//cleanmate get_font_subsets
function cm_ajax_get_font_subsets()
{
	if($_POST["font"]!="")
	{
		$subsets = '';
		$fontExplode = explode(":", $_POST["font"]);
		$subsets_array = cm_get_google_font_subset($fontExplode[0]);
		
		foreach($subsets_array as $subset)
			$subsets .= '<option value="' . esc_attr($subset) . '">' . $subset . '</option>';
		
		echo "cm_start" . $subsets . "cm_end";
	}
	exit();
}
add_action('wp_ajax_cm_get_font_subsets', 'cm_ajax_get_font_subsets');

/**
 * Returns array of Google Fonts
 * @return array of Google Fonts
 */
function cm_get_google_fonts()
{
	//get google fonts
	$fontsArray = get_option("cm_google_fonts");
	//update if option doesn't exist or it was modified more than 2 weeks ago
	if($fontsArray===FALSE || count((array)$fontsArray)==0 || (time()-$fontsArray->last_update>2*7*24*60*60)) 
	{
		$google_api_url = 'http://quanticalabs.com/.tools/GoogleFont/font.txt';
		$fontsJson = wp_remote_retrieve_body(wp_remote_get($google_api_url, array('sslverify' => false)));
		$fontsArray = json_decode($fontsJson);
		$fontsArray->last_update = time();		
		update_option("cm_google_fonts", $fontsArray);
	}
	return $fontsArray;
}

/**
 * Returns array of subsets for provided Google Font
 * @param type $font - Google font
 * @return array of subsets for provided Google Font
 */
function cm_get_google_font_subset($font)
{
	$subsets = array();
	//get google fonts
	$fontsArray = cm_get_google_fonts();		
	$fontsCount = count($fontsArray->items);
	for($i=0; $i<$fontsCount; $i++)
	{
		if($fontsArray->items[$i]->family==$font)
		{
			for($j=0, $max=count($fontsArray->items[$i]->subsets); $j<$max; $j++)
			{
				$subsets[] = $fontsArray->items[$i]->subsets[$j];
			}
			break;
		}
	}
	return $subsets;
}
?>

AnonSec - 2021