<?php
/**
 *
 * SmartAdapt functions and definitions.
 *
 * The functions file is used to initialize everything in the theme.
 * It sets up the supported features, default actions  and filters.
 *
 * @package    WordPress
 * @subpackage SmartAdapt
 * @since      SmartAdapt 1.0
 */
global $pro_link;
$pro_link = 'http://netbiel.pl/smartadapt/smartadaptpro.html';
// include customize class
require( get_stylesheet_directory() . '/inc/classes/theme-options-class.php' );


/**
 * Contains the most important actions to be performed during initialization eg remove parent theme actions
 *
 * since Smartadat max flat 1.0
 */
function smartadaptm_initialize(){

	/*remove header output method added in parent theme*/

	remove_action( 'wp_head', array( 'smartadapt_Customize', 'header_output' ) );

	//remove parent theme customizer
	remove_action( 'customize_register', array( 'smartadapt_Customize', 'register' ) );


}

add_action('init', 'smartadaptm_initialize');



function smartadaptm_setup_theme(){
	remove_theme_support( 'custom-background' );
	add_theme_support( 'custom-background', array(
		'default-color' => 'fff',
	) );

	load_child_theme_textdomain( 'smartadapt-flat', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'smartadaptm_setup_theme' );
/**
 * Add body class to child theme
 *
 * since Smartadat max flat 1.0
 */
function smartadaptm_body_class($classes) {
	$classes[] = 'smartadaptm';
	return $classes;
}
add_filter('body_class', 'smartadaptm_body_class');

function smartadapt_maxflat_scripts_styles() {

	/*deregister main js file scripts*/

	wp_enqueue_script( 'smartadaptm-infield-label', get_stylesheet_directory_uri() . '/js/jquery.infieldlabel.min.js', array( 'jquery' ), '1.0', false );
	wp_enqueue_script( 'smartadapt-main', get_stylesheet_directory_uri() . '/js/main.js', array( 'jquery' ), '1.0', false );

	/* infieldlabel CSS */
	wp_enqueue_style( 'smartadaptm-infield-label', get_stylesheet_directory_uri() . '/css/jquery.infieldlabel.css' );
}
add_action( 'wp_enqueue_scripts', 'smartadapt_maxflat_scripts_styles' );



