<?php
/**
 * Page Settings Metabox
 * Developed & Designed exclusively for the Evatheme WordPress themes
 * Do not copy, re-sell or reproduce!
 *
 * @package Evatheme WordPress Themes
 * @subpackage Framework
 * @version 1.0
 */

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

// The Metabox class
class evatheme_core_Post_Metaboxes {
	private $post_types;

	/**
	 * Register this class with the WordPress API
	 *
	 * @since 1.0.0
	 */
	public function __construct() {

		// Post types to add the metabox to
		$this->post_types = apply_filters( 'evatheme_core_main_metaboxes_post_types', array(
			'post'         => 'post',
			'page'         => 'page',
			'portfolio'    => 'portfolio',
			'product'      => 'product',
		) );

		// Loop through post types and add metabox to corresponding post types
		if ( $this->post_types ) {
			foreach( $this->post_types as $key => $val ) {
				add_action( 'add_meta_boxes_'. $val, array( $this, 'post_meta' ), 11 );
			}
		}

		// Save meta
		add_action( 'save_post', array( $this, 'save_meta_data' ) );

		// Load scripts for the metabox
		add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) );

	}

	/**
	 * The function responsible for creating the actual meta box.
	 *
	 * @since 1.0.0
	 */
	public function post_meta( $post ) {
		
		$obj = get_post_type_object( $post->post_type );
		
		// Add metabox
		add_meta_box(
			'evatheme_core-metabox',
			$obj->labels->singular_name . ' ' . esc_html__( 'Settings', 'restorator' ),
			array( $this, 'display_meta_box' ),
			$post->post_type,
			'normal',
			'high'
		);

	}

	/**
	 * Enqueue scripts and styles needed for the metaboxes
	 *
	 * @since 1.0.0
	 */
	public function load_scripts( $hook ) {

		// Only needed on these admin screens
		if ( $hook != 'edit.php' && $hook != 'post.php' && $hook != 'post-new.php' ) {
			return;
		}

		// Get global post
		global $post;

		// Return if post is not object
		if ( ! is_object( $post ) ) {
			return;
		}

		// Enqueue metabox css
		wp_enqueue_style(
			'evatheme_core-post-metabox',
			get_template_directory_uri() . '/inc/metabox/evatheme_core-metabox.css',
			array(),
			'1.0'
		);

		// Enqueue media js
		wp_enqueue_media();

		// Enqueue color picker
		wp_enqueue_style( 'wp-color-picker' );
		wp_enqueue_script( 'wp-color-picker' );

		// Enqueue metabox js
		wp_enqueue_script(
			'evatheme_core-post-metabox',
			get_template_directory_uri() .'/inc/metabox/evatheme_core-metabox.js',
			array( 'jquery', 'wp-color-picker' ),
			'1.0',
			true
		);

		wp_localize_script( 'evatheme_core-post-metabox', 'evatheme_core_metabox', array(
			'reset'  => esc_html__(  'Reset Settings', 'restorator' ),
			'cancel' => esc_html__(  'Cancel Reset', 'restorator' ),
		) );

	}

	/**
	 * Renders the content of the meta box.
	 *
	 * @since 1.0.0
	 */
	public function display_meta_box( $post ) {

		// Add an nonce field so we can check for it later.
		wp_nonce_field( 'evatheme_core_metabox', 'evatheme_core_metabox_nonce' );

		// Get current post data
		$post_id   = $post->ID;
		$post_type = get_post_type();

		// Get tabs
		$tabs = $this->meta_array( $post );

		// Empty notice
		$empty_notice = '<p>'. esc_html__( 'No meta settings available for this post type or user.', 'restorator' ) .'</p>';

		// Make sure tabs aren't empty
		if ( empty( $tabs ) ) {
			echo $empty_notice; return;
		}

		// Store tabs that should display on this specific page in an array for use later
		$active_tabs = array();
		foreach ( $tabs as $tab ) {
			$tab_post_type = isset( $tab['post_type'] ) ? $tab['post_type'] : '';
			if ( ! $tab_post_type ) {
				$display_tab = true;
			} elseif ( in_array( $post_type, $tab_post_type ) ) {
				$display_tab = true;
			} else {
				$display_tab = false;
			}
			if ( $display_tab ) {
				$active_tabs[] = $tab;
			}
		}

		// No active tabs
		if ( empty( $active_tabs ) ) {
			echo $empty_notice; return;
		} ?>

		<ul class="wp-tab-bar">
			<?php
			// Output tab links
			$count=0;
			foreach ( $active_tabs as $tab ) {
				$count++;
				// Define tab title
				$tab_title = $tab['title'] ? $tab['title'] : esc_html__( 'Other', 'restorator' ); ?>
				<li<?php if ( '1' == $count ) echo ' class="wp-tab-active"'; ?>>
					<a href="javascript:;" data-tab="#evatheme_core-mb-tab-<?php echo $count; ?>">
						<?php if ( isset( $tab['icon'] ) ) { ?>
							<span class="<?php echo esc_attr( $tab['icon'] ) ; ?>"></span>
						<?php } ?>
						<?php echo esc_html( $tab_title ); ?>
					</a>
				</li>
			<?php } ?>
		</ul><!-- .evatheme_core-mb-tabnav -->

		<?php
		// Output tab sections
		$count=0;
		foreach ( $active_tabs as $tab ) {
			$count++; ?>
			<div id="evatheme_core-mb-tab-<?php echo $count; ?>" class="wp-tab-panel clr">
				<table class="form-table">
					<?php
					foreach ( $tab['settings'] as $setting ) {

						$meta_id     = $setting['id'];
						$title       = $setting['title'];
						$hidden      = isset( $setting['hidden'] ) ? $setting['hidden'] : false;
						$type        = isset( $setting['type'] ) ? $setting['type'] : 'text';
						$default     = isset( $setting['default'] ) ? $setting['default'] : '';
						$description = isset( $setting['description'] ) ? $setting['description'] : '';
						$meta_value  = get_post_meta( $post_id, $meta_id, true );
						$meta_value  = $meta_value ? $meta_value : $default; ?>

						<tr<?php if ( $hidden ) echo ' style="display:none;"'; ?> id="<?php echo esc_attr( $meta_id ); ?>_tr">
							<th>
								<label for="evatheme_core_main_layout"><strong><?php echo $title; ?></strong></label>
								<?php
								// Display field description
								if ( $description ) { ?>
									<p class="evatheme_core-mb-description"><?php echo $description; ?></p>
								<?php } ?>
							</th>

							<?php
							// Text Field
							if ( 'text' == $type ) { ?>

								<td><input name="<?php echo esc_attr( $meta_id ); ?>" type="text" value="<?php echo esc_attr( $meta_value ); ?>"></td>

							<?php
							}

							// Button Group
							if ( 'button_group' == $type ) {

								$options = isset ( $setting['options'] ) ? $setting['options'] : '';

								if ( is_array( $options ) ) { ?>

									<td>

										<div class="evatheme_core-mb-btn-group">

											<?php foreach ( $options as $option_value => $option_name ) {

												$class = 'evatheme_core-mb-btn evatheme_core-mb-' . esc_attr( $option_value );

												if ( $option_value == $meta_value ) {
													$class .= ' active';
												}  ?>

												<button type="button" class="<?php echo esc_attr( $class ); ?>" data-value="<?php echo esc_attr( $option_value ); ?>"><?php echo esc_html( $option_name ); ?></button>

											<?php } ?>

											<input name="<?php echo esc_attr( $meta_id ); ?>" type="hidden" value="<?php echo esc_attr( $meta_value ); ?>" class="evatheme_core-mb-hidden">

										</div>

									</td>

								<?php }

							}

							// Enable Disable button group
							if ( 'button_group_ed' == $type ) {

								$options = isset ( $setting['options'] ) ? $setting['options'] : '';

								if ( is_array( $options ) ) { ?>

									<td>

										<div class="evatheme_core-mb-btn-group">
											
											<?php
											// Default
											$active = ! $meta_value ? 'evatheme_core-mb-btn evatheme_core-default active' : 'evatheme_core-mb-btn evatheme_core-default'; ?>

											<button type="button" class="<?php echo esc_attr( $active ); ?>" data-value=""><?php echo esc_html_e( 'Default', 'restorator' ); ?></button>

											<?php
											// Enable
											$active = ( $options['enable'] == $meta_value ) ? 'evatheme_core-mb-btn evatheme_core-on active' : 'evatheme_core-mb-btn evatheme_core-on'; ?>

											<button type="button" class="<?php echo esc_attr( $active ); ?>" data-value="<?php echo esc_attr( $options['enable'] ); ?>"><?php echo esc_html_e( 'Enable', 'restorator' ); ?></button>

											<?php
											// Disable
											$active = ( $options['disable'] == $meta_value ) ? 'evatheme_core-mb-btn evatheme_core-off active' : 'evatheme_core-mb-btn evatheme_core-off'; ?>

											<button type="button" class="<?php echo esc_attr( $active ); ?>" data-value="<?php echo esc_attr( $options['disable'] ); ?>"><?php echo esc_html_e( 'Disable', 'restorator' ); ?></button>

											<input name="<?php echo esc_attr( $meta_id ); ?>" type="hidden" value="<?php echo esc_attr( $meta_value ); ?>" class="evatheme_core-mb-hidden">

										</div>

									</td>

								<?php }

							}

							// Date Field
							elseif ( 'date' == $type ) {

								wp_enqueue_script( 'jquery-ui' );

								wp_enqueue_script( 'jquery-ui-datepicker', array( 'jquery-ui' ) );

								wp_enqueue_style(
									'jquery-ui-datepicker-style',
									'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css'
								); ?>

								<td><input class="evatheme_core-date-meta" name="<?php echo esc_attr( $meta_id ); ?>" type="text" value="<?php echo esc_attr( $meta_value ); ?>"></td>

							<?php }

							// Number Field
							elseif ( 'number' == $type ) {

								$step = isset( $setting['step'] ) ? $setting['step'] : '1';
								$min  = isset( $setting['min'] ) ? $setting['min'] : '1';
								$max  = isset( $setting['max'] ) ? $setting['max'] : '10'; ?>

								<td>
									<input name="<?php echo esc_attr( $meta_id ); ?>" type="number" value="<?php echo esc_attr( $meta_value ); ?>" step="<?php echo floatval( $step ); ?>" min="<?php echo floatval( $min ); ?>" max="<?php echo floatval( $max ); ?>">
								</td>

							<?php }

							// HTML Text
							elseif ( 'text_html' == $type ) { ?>

								<td><input name="<?php echo esc_attr( $meta_id ); ?>" type="text" value="<?php echo esc_html( $meta_value ); ?>"></td>

							<?php }

							// Link field
							elseif ( 'link' == $type ) {

								// Sanitize
								$meta_value = ( 'home_url' == $meta_value ) ? esc_html( $meta_value ) : esc_url( $meta_value ); ?>

								<td><input name="<?php echo esc_attr( $meta_id ); ?>" type="text" value="<?php echo $meta_value; ?>"></td>

							<?php }

							// Textarea Field
							elseif ( 'textarea' == $type ) {
								$rows = isset ( $setting['rows'] ) ? absint( $setting['rows'] ) : 4; ?>

								<td>
									<textarea rows="<?php echo esc_attr( $rows ); ?>" cols="1" name="<?php echo esc_attr( $meta_id ); ?>" type="text" class="evatheme_core-mb-textarea"><?php echo esc_textarea( $meta_value ); ?></textarea>
								</td>

							<?php }

							// Code Field
							elseif ( 'code' == $type ) {
								$rows = isset ( $setting['rows'] ) ? absint( $setting['rows'] ) : 1; ?>

								<td>
									<pre><textarea rows="<?php echo esc_attr( $rows ); ?>" cols="1" name="<?php echo esc_attr( $meta_id ); ?>" type="text" class="evatheme_core-mb-textarea-code"><?php echo $meta_value; ?></textarea></pre>
								</td>

							<?php }

							// Checkbox
							elseif ( 'checkbox' == $type ) {

								$meta_value = ( 'on' != $meta_value ) ? false : true; ?>
								<td><input name="<?php echo esc_attr( $meta_id ); ?>" type="checkbox" <?php checked( $meta_value, true, true ); ?>></td>

							<?php }

							// Select
							elseif ( 'select' == $type ) {

								$options = isset ( $setting['options'] ) ? $setting['options'] : '';

								if ( ! empty( $options ) ) { ?>

									<td><select id="<?php echo esc_attr( $meta_id ); ?>" name="<?php echo esc_attr( $meta_id ); ?>">
									
									<?php foreach ( $options as $option_value => $option_name ) { ?>
										
										<option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $meta_value, $option_value, true ); ?>><?php echo esc_attr( $option_name ); ?></option>

									<?php } ?>

									</select></td>

								<?php }

							}

							// Color
							elseif ( 'color' == $type ) { ?>

								<td><input name="<?php echo esc_attr( $meta_id ); ?>" type="text" value="<?php echo esc_attr( $meta_value ); ?>" class="evatheme_core-mb-color-field"></td>

							<?php }

							//	Layout
							elseif ( 'layout' == $type ) { ?>
					
								<td class="metabox_type_layout">
									<?php  foreach ($setting['options'] as $val => $option) {
										echo '<a href="#" data-value="' . $val . '" ' . ( $val == $meta_value ? ' class="active"' : '' ) . '><img src="'.esc_url($option['img']).'">'.esc_html($option['title']).'</a>';
									} ?>
									<input name="<?php echo $meta_id; ?>" type="hidden" value="<?php echo $meta_value; ?>" />
								</td>

							<?php }
							
							// Media
							elseif ( 'media' == $type ) {

								// Validate data if array - old Redux cleanup
								if ( is_array( $meta_value ) ) {
									if ( ! empty( $meta_value['url'] ) ) {
										$meta_value = $meta_value['url'];
									} else {
										$meta_value = '';
									}
								} ?>
								<td>
									<div class="uploader">
									<input type="text" name="<?php echo esc_attr( $meta_id ); ?>" value="<?php echo esc_attr( $meta_value ); ?>">
									<input class="evatheme_core-mb-uploader button-secondary" name="<?php echo esc_attr( $meta_id ); ?>" type="button" value="<?php esc_html_e( 'Upload', 'restorator' ); ?>" />
									<?php if ( $meta_value ) {
											if ( is_numeric( $meta_value ) ) {
												$meta_value = wp_get_attachment_image_src( $meta_value, 'full' );
												$meta_value = $meta_value[0];
											} ?>
										<div class="evatheme_core-mb-thumb" style="padding-top:10px;"><img src="<?php echo $meta_value; ?>" height="40" width="" style="height:40px;width:auto;max-width:100%;" /></div>
									<?php } ?>
									</div>
								</td>

							<?php }
							
							// Gallery
							elseif ( 'gallery' == $type ) {

								?>
								<td>
									<div id="evatheme_core_gallery_images_container">
										<?php
											$gallery_thumbs = '';
											
											// Validate data if array - old Redux cleanup
											if ( is_array( $meta_value ) ) {
												if ( ! empty( $meta_value['url'] ) ) {
													$meta_value = $meta_value['url'];
												} else {
													$meta_value = '';
												}
											}
											
											if( $meta_value ) {
												$attachments = array_filter( explode( ',', $meta_value ) );
												foreach ( $attachments as $attachment_id ) {
													if ( wp_attachment_is_image ( $attachment_id  ) ) {
														$gallery_thumbs .= '<li class="image" data-attachment_id="' . $attachment_id . '"><div class="attachment-preview"><div class="thumbnail">
																	' . wp_get_attachment_image( $attachment_id, array(32,32) ) . '</div>
																	<a href="#" class="evatheme_core-gmb-remove" title="' . esc_html__( 'Remove image', 'restorator' ) . '">X</a>
																</div></li>';
													}
												}
											}
										?>
										<input type="hidden" id="image_gallery" name="<?php echo $meta_id; ?>" value="<?php echo $meta_value; ?>" />
										<?php wp_nonce_field( 'easy_image_gallery', 'easy_image_gallery' ); ?>
										<ul class="evatheme_core_gallery_images" style="font-size:0;margin-top:6px;"><?php echo $gallery_thumbs;?></ul>
									</div>
									<p class="add_evatheme_core_gallery_images hide-if-no-js">
										<a href="#" class="button-primary"><?php esc_html_e( 'Add/Edit Images', 'restorator' ); ?></a>
									</p>
								</td>

							<?php }

							// Editor
							elseif ( 'editor' == $type ) {
								$teeny= isset( $setting['teeny'] ) ? $setting['teeny'] : false;
								$rows = isset( $setting['rows'] ) ? $setting['rows'] : '10';
								$media_buttons= isset( $setting['media_buttons'] ) ? $setting['media_buttons'] : true; ?>
								<td><?php wp_editor( $meta_value, $meta_id, array(
									'textarea_name' => $meta_id,
									'teeny'         => $teeny,
									'textarea_rows' => $rows,
									'media_buttons' => $media_buttons,
								) ); ?></td>
							<?php } ?>
						</tr>

					<?php } ?>
				</table>
			</div>
		<?php } ?>

		<div class="evatheme_core-mb-reset">
			<a class="button button-secondary evatheme_core-reset-btn"><?php esc_html_e( 'Reset Settings', 'restorator' ); ?></a>
			<div class="evatheme_core-reset-checkbox"><input type="checkbox" name="evatheme_core_metabox_reset"> <?php esc_html_e( 'Are you sure? Check this box, then update your post to reset all settings.', 'restorator' ); ?></div>
		</div>

		<div class="clear"></div>

	<?php }

	/**
	 * Save metabox data
	 *
	 * @since 1.0.0
	 */
	public function save_meta_data( $post_id ) {

		// Get array of settings to save
		$tabs = $this->meta_array( get_post( $post_id ) );

		// No tabs so lets bail
		if ( ! $tabs ) {
			return;
		}

		/*
		 * We need to verify this came from our screen and with proper authorization,
		 * because the save_post action can be triggered at other times.
		 */

		// Check if our nonce is set.
		if ( ! isset( $_POST['evatheme_core_metabox_nonce'] ) ) {
			return;
		}

		// Verify that the nonce is valid.
		if ( ! wp_verify_nonce( $_POST['evatheme_core_metabox_nonce'], 'evatheme_core_metabox' ) ) {
			return;
		}

		// If this is an autosave, our form has not been submitted, so we don't want to do anything.
		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
			return;
		}

		// Check the user's permissions.
		if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {

			if ( ! current_user_can( 'edit_page', $post_id ) ) {
				return;
			}

		} else {

			if ( ! current_user_can( 'edit_post', $post_id ) ) {
				return;
			}
		}

		/* OK, it's safe for us to save the data now. Now we can loop through fields */

		// Check reset field
		$reset = isset( $_POST['evatheme_core_metabox_reset'] ) ? $_POST['evatheme_core_metabox_reset'] : '';

		// Loop through tabs
		$settings = array();
		foreach( $tabs as $tab ) {
			foreach ( $tab['settings'] as $setting ) {
				$settings[] = $setting;
			}
		}

		// Loop through settings and validate
		foreach ( $settings as $setting ) {

			// Vars
			$value = '';
			$id    = $setting['id'];
			$type  = isset ( $setting['type'] ) ? $setting['type'] : 'text';

			// Make sure field exists and if so validate the data
			if ( isset( $_POST[ $id ] ) ) {

				$value = $_POST[ $id ];

				// Validate text
				if ( 'text' == $type || 'text_html' == $type ) {
					$value = wp_kses_post( $value ); // @todo change this?
				}

				// Validate date
				elseif ( 'date' == $type ) {
					$value = strtotime( wp_strip_all_tags( $value ) );
				}

				// Validate textarea
				elseif ( 'textarea' == $type ) {
					$value = esc_html( $value );
				}

				// Links
				elseif ( 'link' == $type ) {
					$value = esc_url( $value );
				}

				// Validate select
				elseif ( 'select' == $type ) {
					if ( 'default' == $value ) {
						$value = '';
					} else {
						$value = wp_strip_all_tags( $value );
					}
				}

				// Validate media
				elseif ( 'media' == $type ) {

					// Move old evatheme_core_post_self_hosted_shortcode_redux to evatheme_core_post_self_hosted_media
					if ( 'evatheme_core_post_self_hosted_media' == $id && empty( $value )
						&& $old = get_post_meta( $post_id, 'evatheme_core_post_self_hosted_shortcode_redux', true )
					) {
						$value = $old;
						delete_post_meta( $post_id, 'evatheme_core_post_self_hosted_shortcode_redux' );
					}

				}

				// Validate editor
				elseif ( 'editor' == $type ) {

					$value = ( '<p><br data-mce-bogus="1"></p>' == $value ) ? '' : $value;

				}

				// Update meta if value exists
				if ( $value && 'on' != $reset ) {
					update_post_meta( $post_id, $id, $value );
				}

				// Otherwise cleanup stuff
				else {
					delete_post_meta( $post_id, $id );
				}

			}

		}

	}

	/**
	 * Get menus
	 */
	public static function get_menus() {
		$menus = array( esc_html__( 'Default', 'restorator' ) );
		$get_menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
		foreach ( $get_menus as $menu) {
			$menus[$menu->term_id] = $menu->name;
		}
		return $menus;
	}

	/**
	 * Get title styles
	 */
	public static function get_title_styles() {
		return apply_filters( 'evatheme_core_title_styles', array(
			'' => esc_html__( 'Default', 'restorator' ),
			'left' => esc_html__( 'Left', 'restorator' ),
			'center' => esc_html__( 'Centered', 'restorator' )
		) );
	}
	
	
	/**
	 * Get visibly element
	 */
	public static function get_element_visibly() {
		return apply_filters( 'evatheme_core_element_visibly', array(
			'' => esc_html__( 'Default', 'restorator' ),
			'show' => esc_html__( 'Shown', 'restorator' ),
			'hide' => esc_html__( 'Hidden', 'restorator' ),
		) );
	}

	/**
	 * Settings Array
	 */
	private function meta_array( $post = null ) {

		// Prefix
		$prefix = 'restorator_';
		
		$theme_uri = get_template_directory_uri();

		// Define array
		$array = array();

		// Store repeatable strings as vars
		$s_default = esc_html__( 'Default', 'restorator' );
		$s_enable  = esc_html__( 'Enable', 'restorator' );
		$s_disable = esc_html__( 'Disable', 'restorator' );
		
		
		if( get_page_template_slug() != "page-comingsoon.php" ) {
			
			// Main Tab
			$array['main'] = array(
				'title' => esc_html__( 'Main', 'restorator' ),
				'post_type' => array( 'page' ),
				'settings' => array(
					'page_layout' =>array(
						'title' => esc_html__( 'Page Layout', 'restorator' ),
						'type' => 'select',
						'id' => $prefix . 'page_layout',
						'description' => esc_html__( 'Select the layout for this page.', 'restorator' ),
						'options' => array(
							'' => esc_html__( 'Default', 'restorator' ),
							'full-width' => esc_html__( 'Full-Width', 'restorator' ),
							'boxed' => esc_html__( 'Boxed', 'restorator' ),
						),
					),
					'page_bg_color' => array(
						'title' 		=> esc_html__( 'Page Background Color', 'restorator' ),
						'description' 	=> esc_html__( 'Select a color for page background.', 'restorator' ),
						'id' 			=> $prefix .'page_bg_color',
						'type' 			=> 'color',
						'default' 		=> '',
					),
					'page_bg_image' => array(
						'title' => esc_html__( 'Page Background Image', 'restorator'),
						'description' => esc_html__( 'Select a custom background image for your page.', 'restorator' ),
						'id' => $prefix . 'page_bg_image',
						'type' => 'media',
					),
					'page_bg_repeat' => array(
						'title' 		=> esc_html__( 'Page Background Repeat', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'page_bg_repeat',
						'options' 		=> array(	
											''				=> esc_html__( 'Default', 'restorator' ),
											'repeat'		=> esc_html__( 'Repeat', 'restorator' ),
											'repeat-x'		=> esc_html__( 'Repeat-x', 'restorator' ),
											'repeat-y'		=> esc_html__( 'Repeat-y', 'restorator' ),
											'no-repeat' 	=> esc_html__( 'No Repeat',  'restorator' )
										),
						'default' 		=> '',
					),
					'page_bg_attachment' => array(
						'title' 		=> esc_html__( 'Page Background Attachment', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'page_bg_attachment',
						'options' 		=> array(	
											''			=> esc_html__( 'Default', 'restorator' ),
											'scroll'	=> esc_html__( 'Scroll', 'restorator' ),
											'fixed'		=> esc_html__( 'Fixed', 'restorator' )
										),
						'default' 		=> '',
					),
					'page_bg_position' => array(
						'title' 		=> esc_html__( 'Page Background Position', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'page_bg_position',
						'options' 		=> array(	
											'' 				=> esc_html__( 'Default', 'restorator' ),
											'left top' 		=> esc_html__( 'Left Top', 'restorator' ),
											'left center' 	=> esc_html__( 'Left Center', 'restorator' ),
											'left bottom' 	=> esc_html__( 'Left Bottom', 'restorator' ),
											'center top' 	=> esc_html__( 'Center Top', 'restorator' ),
											'center center' => esc_html__( 'Center Center', 'restorator' ),
											'center bottom' => esc_html__( 'Center Bottom', 'restorator' ),
											'right top' 	=> esc_html__( 'Right Top', 'restorator' ),
											'right center' 	=> esc_html__( 'Right Center', 'restorator' ),
											'right bottom' 	=> esc_html__( 'Right Bottom', 'restorator' )
										),
						'default' 		=> '',
					),
					'page_bg_full' => array(
						'title' 		=> esc_html__( 'Page Background Size', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'page_bg_full',
						'options' 		=> array(	
											'' 				=> esc_html__( 'Default', 'restorator' ),
											'inherit' 		=> esc_html__( 'Inherit', 'restorator' ),
											'cover' 		=> esc_html__( 'Cover', 'restorator' )
										),
						'default' 		=> '',
					),
				),
			);

			// Header Tab
			$array['header'] = array(
				'title' => esc_html__( 'Header', 'restorator' ),
				'post_type' => array( 'page' ),
				'settings' => array(
					'disable_header' => array(
						'title' => esc_html__( 'Header', 'restorator' ),
						'id' => $prefix . 'disable_header',
						'type' => 'select',
						'description' => esc_html__( 'Enable or disable this element on this page or post.', 'restorator' ),
						'options' => array(
							'enable' => esc_html__( 'Enable', 'restorator' ),
							'disable' => esc_html__( 'Disable', 'restorator' ),
						),
					),
					'header_layout' => array(
						'title' => esc_html__( 'Header Layout', 'restorator' ),
						'id' => $prefix . 'header_layout',
						'type' => 'select',
						'description' => esc_html__( 'You can choose between a header full width style menu or a boxed style menu.', 'restorator' ),
						'options' => array(
							'' => esc_html__( 'Default', 'restorator' ),
							'full_width' => esc_html__( 'Full Width', 'restorator' ),
							'boxed' => esc_html__( 'Boxed', 'restorator' )
						),
						'default' => '',
					),
					'header_page_bg_style' => array(
						'title' => esc_html__( 'Header Background Style', 'restorator' ),
						'id' => $prefix . 'header_page_bg_style',
						'type' => 'select',
						'description' => esc_html__( 'Select a background style for this header. settings of background color, transparency or settings of gradient will be taken from the Theme Options.', 'restorator' ),
						'options' => array(
							'' => esc_html__( 'Default', 'restorator' ),
							'gradient' => esc_html__( 'Gradient', 'restorator' ),
							'bgcolor' => esc_html__( 'Background Color', 'restorator' ),
						),
						'default' => '',
					),
				),
			);

			// Title Tab
			$array['title'] = array(
				'title' => esc_html__( 'Title', 'restorator' ),
				'post_type' => array( 'page' ),
				'settings' => array(
					'pagetitle' => array(
						'title' => esc_html__( 'Title', 'restorator' ),
						'description' => esc_html__( 'Enable or disable title on this page or post.', 'restorator' ),
						'id' => $prefix . 'pagetitle',
						'type' => 'select',
						'options' => $this->get_element_visibly(),
						'default' => '',
					),
					'pagetitle_text' => array(
						'title' => esc_html__( 'Page Title', 'restorator' ),
						'description' => esc_html__( 'Please enter the page title.', 'restorator' ),
						'type' => 'text',
						'id' => $prefix . 'pagetitle_text',
					),
					'pagetitle_subtext' => array(
						'title' => esc_html__( 'Subheading', 'restorator' ),
						'description' => esc_html__( 'Enter your page subheading.', 'restorator' ),
						'type' => 'text',
						'id' => $prefix . 'pagetitle_subtext',
					),
					'pagetitle_style' => array(
						'title' => esc_html__( 'Title Style', 'restorator' ),
						'description' => esc_html__( 'Select a custom title style for this page or post.', 'restorator' ),
						'type' => 'select',
						'id' => $prefix . 'pagetitle_style',
						'options' => array(
							'' => esc_html__( 'Default', 'restorator' ),
							'background-image' => esc_html__( 'Background Image', 'restorator' ),
						),
					),
					'pagetitle_bg_color' => array(
						'title' 		=> esc_html__( 'Page Title Background Color', 'restorator' ),
						'description' 	=> esc_html__( 'Select a color.', 'restorator' ),
						'id' 			=> $prefix .'pagetitle_bg_color',
						'type' 			=> 'color',
						'default' 		=> '#696969',
					),
					'pagetitle_bg_image' => array(
						'title' => esc_html__( 'Page Title Background Image', 'restorator'),
						'description' => esc_html__( 'Select a custom header image for your main title.', 'restorator' ),
						'id' => $prefix . 'pagetitle_bg_image',
						'type' => 'media',
					),
					'pagetitle_bg_repeat' => array(
						'title' 		=> esc_html__( 'Page Title Background Repeat', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'pagetitle_bg_repeat',
						'options' 		=> array(	
											'repeat'		=> esc_html__( 'Repeat', 'restorator' ),
											'repeat-x'		=> esc_html__( 'Repeat-x', 'restorator' ),
											'repeat-y'		=> esc_html__( 'Repeat-y', 'restorator' ),
											'no-repeat' 	=> esc_html__( 'No Repeat',  'restorator' )
										),
						'default' 		=> 'no-repeat',
					),
					'pagetitle_bg_attachment' => array(
						'title' 		=> esc_html__( 'Page Title Background Attachment', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'pagetitle_bg_attachment',
						'options' 		=> array(	
											'scroll'	=> esc_html__( 'Scroll', 'restorator' ),
											'fixed'		=> esc_html__( 'Fixed', 'restorator' )
										),
						'default' 		=> 'scroll',
					),
					'pagetitle_bg_position' => array(
						'title' 		=> esc_html__( 'Page Title Background Position', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'pagetitle_bg_position',
						'options' 		=> array(	
											'left top' 		=> esc_html__( 'Left Top', 'restorator' ),
											'left center' 	=> esc_html__( 'Left Center', 'restorator' ),
											'left bottom' 	=> esc_html__( 'Left Bottom', 'restorator' ),
											'center top' 	=> esc_html__( 'Center Top', 'restorator' ),
											'center center' => esc_html__( 'Center Center', 'restorator' ),
											'center bottom' => esc_html__( 'Center Bottom', 'restorator' ),
											'right top' 	=> esc_html__( 'Right Top', 'restorator' ),
											'right center' 	=> esc_html__( 'Right Center', 'restorator' ),
											'right bottom' 	=> esc_html__( 'Right Bottom', 'restorator' )
										),
						'default' 		=> 'center center',
					),
					'pagetitle_bg_full' => array(
						'title' 		=> esc_html__( 'Page Title Background Size', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'pagetitle_bg_full',
						'options' 		=> array(	
											'inherit' 		=> esc_html__( 'Inherit', 'restorator' ),
											'cover' 		=> esc_html__( 'Cover', 'restorator' )
										),
						'default' 		=> 'cover',
					),
					'pagetitle_bg_image_parallax' => array(
						'title' 		=> esc_html__( 'Parallax Effect', 'restorator' ),
						'description' 	=> esc_html__( 'Enable this to the parallax effect for background image.', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'pagetitle_bg_image_parallax',
						'options' 		=> array(	
											''		 		=> esc_html__( 'Default', 'restorator' ),
											'disable' 		=> esc_html__( 'Disable', 'restorator' ),
											'enable' 		=> esc_html__( 'Enable', 'restorator' )
										),
						'default' 		=> '',
					),
					'pagetitle_text_color' => array(
						'title' 		=> esc_html__( 'Page Title Text Color', 'restorator' ),
						'description' 	=> esc_html__( 'Select a text color.', 'restorator' ),
						'id' 			=> $prefix .'pagetitle_text_color',
						'type' 			=> 'color',
						'default' 		=> '#ffffff',
					),
					
					'breadcrumbs' => array(
						'title' => esc_html__( 'Breadcrumbs', 'restorator' ),
						'description' => esc_html__( 'Enable or disable breadcrumbs on this page or post.', 'restorator' ),
						'id' => $prefix . 'breadcrumbs',
						'type' => 'select',
						'options' => $this->get_element_visibly(),
						'default' => '',
					),
				),
			);
			

			// Footer tab
			$array['footer'] = array(
				'title' => esc_html__( 'Footer', 'restorator' ),
				'post_type' => array( 'page' ),
				'settings' => array(
					'enable_prefooter' => array(
						'title' => esc_html__( 'Prefooter Area', 'restorator' ),
						'description' => esc_html__( 'Show or hide prefooter area.', 'restorator' ),
						'id' => $prefix . 'enable_prefooter',
						'type' => 'select',
						'options' => $this->get_element_visibly(),
						'default' => '',
					),
					'footer' => array(
						'title' => esc_html__( 'Footer Area', 'restorator' ),
						'description' => esc_html__( 'Show or hide Footer Area.', 'restorator' ),
						'id' => $prefix . 'footer',
						'type' => 'select',
						'options' => $this->get_element_visibly(),
						'default' => '',
					),
					'footer_layout' => array(
						'title' => esc_html__( 'Footer Layout', 'restorator' ),
						'id' => $prefix . 'footer_layout',
						'type' => 'select',
						'description' => esc_html__( 'You can choose between a full width style or a boxed style footer.', 'restorator' ),
						'options' => array(
							'' => esc_html__( 'Default', 'restorator' ),
							'full_width' => esc_html__( 'Full Width', 'restorator' ),
							'boxed' => esc_html__( 'Boxed', 'restorator' )
						),
						'default' => '',
					),
				),
			);
		}

		// Post tab
		$array['media'] = array(
			'title' => esc_html__( 'Post', 'restorator' ),
			'post_type' => array( 'post' ),
			'settings' => array(
				'metro' => array(
					'title' => esc_html__( 'Masonry Item Sizing', 'restorator' ),
					'description' => esc_html__( 'This will only be used if you choose to display your Blog Posts in the "Metro Style" in element settings', 'restorator' ),
					'id' => $prefix . 'metro',
					'type' => 'select',
					'options' => array(
						'' => esc_html__( 'Default', 'restorator' ),
						'width2' => esc_html__( 'Double Width', 'restorator' ),
						'height2' => esc_html__( 'Double Height', 'restorator' ),
						'wh2' => esc_html__( 'Double Width and Height', 'restorator' ),
					),
					'default' => '',
				),
				'post_single_style' => array(
					'title' => esc_html__( 'Featured Image Style', 'restorator' ),
					'description' => esc_html__( 'Select the style of a single post page. featured image in full screen or standard', 'restorator' ),
					'id' => $prefix . 'post_single_style',
					'type' => 'select',
					'options' => array(
						'' => esc_html__( 'Default', 'restorator' ),
						'fullscreen' => esc_html__( 'Full screen', 'restorator' ),
					),
				),
				'post_quote_text' => array(
					'title' => esc_html__( 'Quote', 'restorator' ),
					'description' => esc_html__( 'Write your quote in this field. Will show only for Quote Post Format.', 'restorator' ),
					'id' => $prefix . 'post_quote_text',
					'type' => 'textarea',
					'rows' => '2',
				),
				'post_quote_author' => array(
					'title' => esc_html__( 'Quote Author', 'restorator' ),
					'description' => esc_html__( 'Write your quote author in this field. Will show only for Quote Post Format.', 'restorator' ),
					'id' => $prefix . 'post_quote_author',
					'type' => 'text',
				),
				'post_quote_author_position' => array(
					'title' => esc_html__( 'Quote Author Position', 'restorator' ),
					'description' => esc_html__( 'Write your quote author position in this field. Will show only for Quote Post Format.', 'restorator' ),
					'id' => $prefix . 'post_quote_author_position',
					'type' => 'text',
				),
				'post_link' => array(
					'title' => esc_html__( 'Link', 'restorator' ),
					'description' => esc_html__( 'Write your link in this field. Will show only for Link Post Format.', 'restorator' ),
					'id' => $prefix . 'post_link',
					'type' => 'text',
				),
				'post_gallery' => array(
					'title' => esc_html__( 'Gallery', 'restorator' ),
					'description' => esc_html__( 'Select the images that should be upload to this gallery. Will show only for Gallery Post Format.', 'restorator' ),
					'id' => 'gallery_image_ids',
					'type' => 'gallery',
				),
				'post_video_embed' => array(
					'title' => esc_html__( 'Video Embed Code', 'restorator' ),
					'description' => esc_html__( 'Insert Youtube or Vimeo embed code. Videos will show only for Video Post Format.', 'restorator' ),
					'id' => $prefix . 'post_video_embed',
					'type' => 'textarea',
					'rows' => '2',
				),
				'post_audio_embed' => array(
					'title' => esc_html__( 'Audio Embed Code', 'restorator' ),
					'description' => esc_html__( 'Insert audio embed code. Audios will show only for Audio Post Format.', 'restorator' ),
					'id' => $prefix . 'post_audio_embed',
					'type' => 'textarea',
					'rows' => '2',
				),
			),
		);


		// Portfolio Tab
		if ( class_exists( 'evatheme_cpt' ) ) {
			$obj= get_post_type_object( 'portfolio' );
			$tab_title = $obj->labels->singular_name;
			$array['portfolio'] = array(
				'title' => $tab_title,
				'post_type' => array( 'portfolio' ),
				'settings' => array(
					'portfolio_single_layout' => array(
						'title' => esc_html__( 'Layout', 'restorator' ),
						'description' => esc_html__( 'Select page layout for single portfolio', 'restorator' ),
						'id' => $prefix . 'portfolio_single_layout',
						'type' => 'select',
						'options' => array(
							'full_width' => esc_html__( 'Full width (Description on top, images bottom)', 'restorator' ),
							'half_width' => esc_html__( 'Half width (Description right, images left)', 'restorator' ),
						),
					),
					'portfolio_single_client' => array(
						'title' => esc_html__( 'Client', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_client',
						'type' => 'text',
					),
					'portfolio_single_add_field_title' => array(
						'title' => esc_html__( 'Additional Field Title', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_add_field_title',
						'type' => 'text',
					),
					'portfolio_single_add_field' => array(
						'title' => esc_html__( 'Additional Field', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_add_field',
						'type' => 'text',
					),
					'portfolio_single_add_field_title2' => array(
						'title' => esc_html__( 'Additional Field Title 2', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_add_field_title2',
						'type' => 'text',
					),
					'portfolio_single_add_field2' => array(
						'title' => esc_html__( 'Additional Field 2', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_add_field2',
						'type' => 'text',
					),
					'portfolio_single_add_field_title3' => array(
						'title' => esc_html__( 'Additional Field Title 3', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_add_field_title3',
						'type' => 'text',
					),
					'portfolio_single_add_field3' => array(
						'title' => esc_html__( 'Additional Field 3', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_add_field3',
						'type' => 'text',
					),
					'portfolio_single_link' => array(
						'title' => esc_html__( 'Link', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_link',
						'type' => 'text',
					),
					'portfolio_single_link_name' => array(
						'title' => esc_html__( 'Link Name', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'portfolio_single_link_name',
						'type' => 'text',
					),
					'posrtfolio_single_iframe' => array(
						'title' => esc_html__( 'Embed Code', 'restorator' ),
						'description' => esc_html__( 'Insert your embed/iframe code.', 'restorator' ),
						'id' => $prefix . 'posrtfolio_single_iframe',
						'type' => 'textarea',
						'rows' => '2',
					),
					'portfolio_single_gallery' => array(
						'title' => esc_html__( 'Gallery', 'restorator' ),
						'description' => esc_html__( 'Select the images that should be upload to this gallery. Will show only for Gallery Post Format.', 'restorator' ),
						'id' => 'gallery_image_ids',
						'type' => 'gallery',
					),
					'portfolio_single_carousel_enable' => array(
						'title' => esc_html__( 'Gallery Carousel', 'restorator' ),
						'description' => esc_html__( 'Enable this to show images in carousel.', 'restorator' ),
						'id' => $prefix . 'portfolio_single_carousel_enable',
						'type' => 'select',
						'options' => array(
							'enable' => esc_html__( 'Enable', 'restorator' ),
							'disable' => esc_html__( 'Disable', 'restorator' ),
						),
					),
					'portfolio_single_carousel_layout' => array(
						'title' => esc_html__( 'Gallery Layout', 'restorator' ),
						'description' => esc_html__( 'Enable this to show full width carousel. Only for "Full Width Layout"', 'restorator' ),
						'id' => $prefix . 'portfolio_single_carousel_layout',
						'type' => 'select',
						'options' => array(
							'boxed' => esc_html__( 'Boxed', 'restorator' ),
							'full_width' => esc_html__( 'Full_width', 'restorator' ),
						),
					),
					'portfolio_single_grid_pullleft' => array(
						'title' => esc_html__( 'Images Position', 'restorator' ),
						'description' => esc_html__( 'Enable the option to press all of the images to the left side of the monitor. Only for "Gallery Carousel -> Disable"', 'restorator' ),
						'id' => $prefix . 'portfolio_single_grid_pullleft',
						'type' => 'select',
						'options' => array(
							'disable' => esc_html__( 'Disable', 'restorator' ),
							'enable' => esc_html__( 'Enable', 'restorator' ),
						),
					),
				),
			);
		}
		
		
		//	Coming Soon Tab
		if (get_page_template_slug() == "page-comingsoon.php") {
			
			$restorator_comings_soon_years = array('2016'=>'2016','2017'=>'2017','2018'=>'2018','2019'=>'2019','2020'=>'2020');
			$restorator_comings_soon_months = array(
				'01'=>esc_html__('January','restorator'),'02'=>esc_html__('February','restorator'),'03'=>esc_html__('March','restorator'),
				'04'=>esc_html__('April','restorator'),'05'=>esc_html__('May','restorator'),'06'=>esc_html__('June','restorator'),
				'07'=>esc_html__('July','restorator'),'08'=>esc_html__('August','restorator'),'09'=>esc_html__('Septempber','restorator'),
				'10'=>esc_html__('October','restorator'),'11'=>esc_html__('November','restorator'),'12'=>esc_html__('December','restorator'));
			$restorator_comings_soon_days = array(
				'01' => '1','02' => '2','03' => '3','04' => '4','05' => '5',
				'06' => '6','07' => '7','08' => '8','09' => '9','10' => '10',
				'11' => '11','12' => '12','13' => '13','14' => '14','15' => '15',
				'16' => '16','17' => '17','18' => '18','19' => '19','20' => '20',
				'21' => '21','22' => '22','23' => '23','24' => '24','25' => '25',
				'26' => '26','27' => '27','28' => '28','29' => '29','30' => '30','31' => '31',
			);
			
			$array['coming_soon'] = array(
				'title' => esc_html__( 'Coming Soon', 'restorator' ),
				'post_type' => array( 'page' ),
				'settings' => array(
					'coming_soon_years' => array(
						'title' => esc_html__( 'Years', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'comings_soon_years',
						'type' => 'select',
						'options' => $restorator_comings_soon_years,
						'default' => '2020',
					),
					'coming_soon_months' => array(
						'title' => esc_html__( 'Months', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'comings_soon_months',
						'type' => 'select',
						'options' => $restorator_comings_soon_months,
						'default' => '01',
					),
					'coming_soon_days' => array(
						'title' => esc_html__( 'Days', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'comings_soon_days',
						'type' => 'select',
						'options' => $restorator_comings_soon_days,
						'default' => '01',
					),
					'coming_soon_subtitle' => array(
						'title' => esc_html__( 'Subtitle', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'coming_soon_subtitle',
						'type' => 'text',
						'default' => 'The site is under construction',
					),
					'coming_soon_title' => array(
						'title' => esc_html__( 'Title', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'coming_soon_title',
						'type' => 'text',
						'default' => 'Coming Soon',
					),
					'coming_soon_descr' => array(
						'title' => esc_html__( 'Description', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'coming_soon_descr',
						'type' => 'text',
						'default' => 'If you have any questions please contact us by e-mail:',
					),
					'coming_soon_email' => array(
						'title' => esc_html__( 'E-mail', 'restorator' ),
						'description' => '',
						'id' => $prefix . 'coming_soon_email',
						'type' => 'text',
						'default' => 'info@evatheme.com',
					),
					'coming_soon_bg_color' => array(
						'title' 		=> esc_html__( 'Background Color', 'restorator' ),
						'description' 	=> '',
						'id' 			=> $prefix .'coming_soon_bg_color',
						'type' 			=> 'color',
						'default' 		=> '#4c4e50',
					),
					'coming_soon_bg_image' => array(
						'title' => esc_html__( 'Background Image', 'restorator'),
						'description' => '',
						'id' => $prefix . 'coming_soon_bg_image',
						'type' => 'media',
					),
					'coming_soon_bg_repeat' => array(
						'title' 		=> esc_html__( 'Background Repeat', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'coming_soon_bg_repeat',
						'options' 		=> array(	
											'repeat'		=> esc_html__( 'Repeat', 'restorator' ),
											'repeat-x'		=> esc_html__( 'Repeat-x', 'restorator' ),
											'repeat-y'		=> esc_html__( 'Repeat-y', 'restorator' ),
											'no-repeat' 	=> esc_html__( 'No Repeat',  'restorator' )
										),
						'default' 		=> 'no-repeat',
					),
					'coming_soon_bg_attachment' => array(
						'title' 		=> esc_html__( 'Background Attachment', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'coming_soon_bg_attachment',
						'options' 		=> array(	
											'scroll'	=> esc_html__( 'Scroll', 'restorator' ),
											'fixed'		=> esc_html__( 'Fixed', 'restorator' )
										),
						'default' 		=> 'scroll',
					),
					'coming_soon_bg_position' => array(
						'title' 		=> esc_html__( 'Background Position', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'coming_soon_bg_position',
						'options' 		=> array(	
											'left top' 		=> esc_html__( 'Left Top', 'restorator' ),
											'left center' 	=> esc_html__( 'Left Center', 'restorator' ),
											'left bottom' 	=> esc_html__( 'Left Bottom', 'restorator' ),
											'center top' 	=> esc_html__( 'Center Top', 'restorator' ),
											'center center' => esc_html__( 'Center Center', 'restorator' ),
											'center bottom' => esc_html__( 'Center Bottom', 'restorator' ),
											'right top' 	=> esc_html__( 'Right Top', 'restorator' ),
											'right center' 	=> esc_html__( 'Right Center', 'restorator' ),
											'right bottom' 	=> esc_html__( 'Right Bottom', 'restorator' )
										),
						'default' 		=> 'center center',
					),
					'coming_soon_bg_full' => array(
						'title' 		=> esc_html__( 'Background Size', 'restorator' ),
						'type' 			=> 'select',
						'id' 			=> $prefix . 'coming_soon_bg_full',
						'options' 		=> array(	
											'inherit' 		=> esc_html__( 'Inherit', 'restorator' ),
											'cover' 		=> esc_html__( 'Cover', 'restorator' )
										),
						'default' 		=> 'cover',
					),
				),
			);
		}

		// Apply filter & return settings array
		return apply_filters( 'evatheme_core_metabox_array', $array, $post );

	}

}

// Start class if enabled => Filter can be used to disable class for certain users
new evatheme_core_Post_Metaboxes();