<?php

	$theme_config = array(
		'options_prefix' => 'zn_kallyas_optionsv4', // The DB options field name
		'theme_id' => 'kallyas', // The theme id that will be used for options field
		'name'           => 'Kallyas', // The theme name
		'version'        => '4.0.1', // The theme version
		'debug'          => false, // If we are on debug mode or not
		'supports'       => array(
			'pagebuilder'  	=> true,
			'megamenu'     	=> true,
			'iconmanager'  	=> true,
			'imageresizer' 	=> false,
			'shortcodes' 	=> false,
			'theme_updater'	=> array(
				'author' => 'Hogash',
				'admin_parent' => 'advanced_options', 
			),
		)
	);

	// Change the advanced tab to advanced_options. This is needed for the custom css save
	function zn_add_custom_css_saving( $saved_options ){
		if ( isset( $saved_options['advanced_options']['custom_css'] ) ) {
			$custom_css = $saved_options['advanced_options']['custom_css'];
			$uploads = wp_upload_dir();
			$zn_uploads_dir = trailingslashit( $uploads['basedir'] );

			file_put_contents( $zn_uploads_dir . 'zn_custom_css.css', $custom_css );

			unset( $saved_options['advanced_options']['custom_css'] );
		}

		return $saved_options;
	}
	add_filter( 'zn_options_to_save', 'zn_add_custom_css_saving' );
