<?php
/**
 * @package Demo Import
 * @since 1.0.0
 */

class ThemeWhizzie {

	protected $version = '1.1.0';

	/** @var string Current theme name, used as namespace in actions. */
	protected $theme_name = '';
	protected $theme_title = '';

	/** @var string Demo Import page slug and title. */
	protected $page_slug = '';
	protected $page_title = '';

	/** @var array Demo Import steps set by user. */
	protected $config_steps = array();

	/**
	 * Constructor
	 *
	 * @param $pizza_parlor_config	Our config parameters
	*/
	public function __construct( $pizza_parlor_config ) {
		$this->set_vars( $pizza_parlor_config );
		$this->init();
	}
	public $parent_slug;
	/**
	 * Set some settings
	 * @since 1.0.0
	 * @param $pizza_parlor_config	Our config parameters
	*/
	public function set_vars( $pizza_parlor_config ) {
		if( isset( $pizza_parlor_config['page_slug'] ) ) {
			$this->page_slug = esc_attr( $pizza_parlor_config['page_slug'] );
		}
		if( isset( $pizza_parlor_config['page_title'] ) ) {
			$this->page_title = esc_attr( $pizza_parlor_config['page_title'] );
		}
		if( isset( $pizza_parlor_config['steps'] ) ) {
			$this->config_steps = $pizza_parlor_config['steps'];
		}

		$current_theme = wp_get_theme();
		$this->theme_title = $current_theme->get( 'Name' );
		$this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) );
		$this->page_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_page_slug', $this->theme_name . '-demoimport' );
		$this->parent_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_parent_slug', '' );
	}

	/**
	 * Hooks and filters
	 * @since 1.0.0
	*/
	public function init() {
		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
		add_action( 'admin_menu', array( $this, 'menu_page' ) );
		add_action( 'wp_ajax_setup_widgets', array( $this, 'setup_widgets' ) );
	}

	public function enqueue_scripts() {
		wp_enqueue_style( 'demo-import-style', get_template_directory_uri() . '/demo-import/assets/css/demo-import-style.css');
		wp_register_script( 'demo-import-script', get_template_directory_uri() . '/demo-import/assets/js/demo-import-script.js', array( 'jquery' ), time() );
		wp_localize_script(
			'demo-import-script',
			'pizza_parlor_whizzie_params',
			array(
				'ajaxurl' 		=> admin_url( 'admin-ajax.php' ),
				'wpnonce' 		=> wp_create_nonce( 'whizzie_nonce' ),
				'verify_text'	=> esc_html( 'verifying', 'pizza-parlor' )
			)
		);
		wp_enqueue_script( 'demo-import-script' );
	}

	/**  Make a modal screen for the wizard **/
	public function menu_page() {
		add_menu_page( esc_html( $this->page_title ), esc_html( $this->page_title ), 'manage_options', $this->page_slug, array( $this, 'pizza_parlor_guide' ) ,'',40);
	}

	/** Make an interface for the wizard **/
	public function wizard_page() {
		/* If we arrive here, we have the filesystem */ ?>
		<div class="wrap">
			<?php echo '<div class="whizzie-wrap">';
				// The wizard is a list with only one item visible at a time
				$steps = $this->get_steps();
				echo '<ul class="whizzie-nav wizard-icon-nav">';?>
				<?php
					$stepI=1;
					foreach( $steps as $step ) {
						$stepAct=($stepI ==1)? 1 : 0;
						if( isset( $step['icon_text'] ) && $step['icon_text'] ) {
							echo '<li class="commom-cls nav-step-' . esc_attr( $step['id'] ) . '" wizard-steps="step-'.esc_attr( $step['id'] ).'" data-enable="'.$stepAct.'">
							<p>'.esc_attr( $step['icon_text'] ).'</p>
							</li>';
						}
					$stepI++;}
			 	echo '</ul>';
				echo '<ul class="whizzie-menu wizard-menu-page">';
				foreach( $steps as $step ) {
					$class = 'step step-' . esc_attr( $step['id'] );
					echo '<li data-step="' . esc_attr( $step['id'] ) . '" class="' . esc_attr( $class ) . '" >';
						$content = call_user_func( array( $this, $step['view'] ) );
						printf('<div class="wizard-button-wrapper">');
							if( isset( $step['button_text_one'] )) {
								printf(
									'<div class="button-wrap button-wrap-one">
										<a href="#" class="button button-primary do-it" data-callback="install_widgets" data-step="widgets"><p class="demo-type-text">%s</p></a>
									</div>',
									esc_html( $step['button_text_one'] )
								);
							}
						printf('</div>');
					echo '</li>';
				}
				echo '</ul>';
				?>
				<div class="step-loading"><span class="spinner">
					<img src="<?php echo esc_url(get_template_directory_uri().'/demo-import/assets/images/Spinner-Animaion.gif'); ?>">
				</span></div>
			<?php echo '</div>';?>
		</div>
	<?php }

	/**
	 * Set options for the steps
	 * @return Array
	*/
	public function get_steps() {
		$dev_steps = $this->config_steps;
		$steps = array(
			'widgets' => array(
				'id'			=> 'widgets',
				'title'			=> __( 'Customizer', 'pizza-parlor' ),
				'icon'			=> 'welcome-widgets-menus',
				'view'			=> 'get_step_widgets',
				'callback'		=> 'install_widgets',
				'button_text_one'	=> __( 'Import Demo', 'pizza-parlor' ),
				'can_skip'		=> true,
				'icon_text'      => 'Import Demo'
			),
			'done' => array(
				'id'			=> 'done',
				'title'			=> __( 'All Done', 'pizza-parlor' ),
				'icon'			=> 'yes',
				'view'			=> 'get_step_done',
				'callback'		=> '',
				'icon_text'      => 'Done'
			)
		);
		// Iterate through each step and replace with dev config values
		if( $dev_steps ) {
			// Configurable elements - these are the only ones the dev can update from config.php
			$can_config = array( 'title', 'icon', 'button_text', 'can_skip' );
			foreach( $dev_steps as $dev_step ) {
				// We can only proceed if an ID exists and matches one of our IDs
				if( isset( $dev_step['id'] ) ) {
					$id = $dev_step['id'];
					if( isset( $steps[$id] ) ) {
						foreach( $can_config as $element ) {
							if( isset( $dev_step[$element] ) ) {
								$steps[$id][$element] = $dev_step[$element];
							}
						}
					}
				}
			}
		}
		return $steps;
	}

	/**    Print the content for the intro step     **/
		public function get_step_importer() { ?>
		<div class="summary">
			<p>
				<?php esc_html_e('Thank you for choosing this Pizza Parlor Theme. Using this quick setup wizard, you will be able to configure your new website and get it running in just a few minutes. Just follow these simple steps mentioned in the wizard and get started with your website.','pizza-parlor'); ?>
			</p>
		</div>
	<?php }

	/**   Print the content for the widgets step   **/
	public function get_step_widgets() { ?>
		<div class="summary">
			<p>
				<?php esc_html_e('This theme allows you to import demo content and add widgets. Install them using the button below. You can also update or deactivate them using the Customizer.','pizza-parlor'); ?>
			</p>
		</div>
	<?php }

	/** Print the content for the final step **/
	public function get_step_done() { ?>

		<div class="setup-finish">
			<p>
				<?php echo esc_html('Your demo content has been imported successfully. Click the finish button for more information.'); ?>
			</p>
			<div class="finish-buttons">
				<a href="<?php echo esc_url( admin_url( 'themes.php?page=pizza-parlor-getstart-page' ) ); ?>" class="wz-btn-customizer" target="_blank"><?php esc_html_e('About Pizza Parlor','pizza-parlor') ?></a>
				<a href="<?php echo esc_url(admin_url('/customize.php')); ?>" class="wz-btn-customizer" target="_blank"><?php esc_html_e('Customize Your Demo','pizza-parlor') ?></a>
				<a href="" class="wz-btn-builder" target="_blank"><?php esc_html_e('Customize Your Demo','pizza-parlor'); ?></a>
				<a href="<?php echo esc_url(home_url()); ?>" class="wz-btn-visit-site" target="_blank"><?php esc_html_e('Visit Your Site','pizza-parlor'); ?></a>
			</div>
			<div class="finish-buttons">
				<a href="<?php echo esc_url(admin_url()); ?>" class="button button-primary"><?php esc_html_e('Finish','pizza-parlor'); ?></a>
			</div>
		</div>

	<?php }


	public function pizza_parlor_customizer_nav_menu() {
		// ------- Create Primary Menu --------
		$pizza_parlor_themename = 'Pizza Parlor'; // Ensure the theme name is set
		$pizza_parlor_menuname = $pizza_parlor_themename . ' Primary Menu';
		$pizza_parlor_menulocation = 'menu-1';
		$pizza_parlor_menu_exists = wp_get_nav_menu_object($pizza_parlor_menuname);

		if (!$pizza_parlor_menu_exists) {
			$pizza_parlor_menu_id = wp_create_nav_menu($pizza_parlor_menuname);

			// Home
			wp_update_nav_menu_item($pizza_parlor_menu_id, 0, array(
				'menu-item-title' => __('Home', 'pizza-parlor'),
				'menu-item-classes' => 'home',
				'menu-item-url' => home_url('/'),
				'menu-item-status' => 'publish'
			));

			// Blog
			$pizza_parlor_page_blog = get_page_by_path('blog');
			if($pizza_parlor_page_blog){
				wp_update_nav_menu_item($pizza_parlor_menu_id, 0, array(
					'menu-item-title' => __('Blog', 'pizza-parlor'),
					'menu-item-classes' => 'blog',
					'menu-item-url' => get_permalink($pizza_parlor_page_blog),
					'menu-item-status' => 'publish'
				));
			}

			// Contact
			$pizza_parlor_page_contact = get_page_by_path('contact');
			if($pizza_parlor_page_contact){
				wp_update_nav_menu_item($pizza_parlor_menu_id, 0, array(
					'menu-item-title' => __('Contact', 'pizza-parlor'),
					'menu-item-classes' => 'contact',
					'menu-item-url' => get_permalink($pizza_parlor_page_contact),
					'menu-item-status' => 'publish'
				));
			}

			// Team
			$pizza_parlor_page_team = get_page_by_path('team');
			if($pizza_parlor_page_team){
				wp_update_nav_menu_item($pizza_parlor_menu_id, 0, array(
					'menu-item-title' => __('Team', 'pizza-parlor'),
					'menu-item-classes' => 'team',
					'menu-item-url' => get_permalink($pizza_parlor_page_team),
					'menu-item-status' => 'publish'
				));
			}

			// Testimonial
			$pizza_parlor_page_testimonial = get_page_by_path('testimonial');
			if($pizza_parlor_page_testimonial){
				wp_update_nav_menu_item($pizza_parlor_menu_id, 0, array(
					'menu-item-title' => __('Testimonial', 'pizza-parlor'),
					'menu-item-classes' => 'testimonial',
					'menu-item-url' => get_permalink($pizza_parlor_page_testimonial),
					'menu-item-status' => 'publish'
				));
			}

			// Assign menu to location if not set
			if (!has_nav_menu($pizza_parlor_menulocation)) {
				$pizza_parlor_locations = get_theme_mod('nav_menu_locations');
				$pizza_parlor_locations[$pizza_parlor_menulocation] = $pizza_parlor_menu_id; // Use $pizza_parlor_menu_id here
				set_theme_mod('nav_menu_locations', $pizza_parlor_locations);
			}
		}
	}

	public function pizza_parlor_social_menu() {

		// ------- Create Social Menu --------
		$pizza_parlor_menuname = $pizza_parlor_themename . 'Social Menu 1';
		$pizza_parlor_menulocation = 'social-menu';
		$pizza_parlor_menu_exists = wp_get_nav_menu_object( $pizza_parlor_menuname );

		if( !$pizza_parlor_menu_exists){
			$pizza_parlor_menu_id = wp_create_nav_menu($pizza_parlor_menuname);

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Facebook', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.facebook.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Pinterest', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.pinterest.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Twitter', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.twitter.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Youtube', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.youtube.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Instagram', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.instagram.com',
				'menu-item-status' => 'publish',
			) );

			if( !has_nav_menu( $pizza_parlor_menulocation ) ){
					$locations = get_theme_mod('nav_menu_locations');
					$locations[$pizza_parlor_menulocation] = $pizza_parlor_menu_id;
					set_theme_mod( 'nav_menu_locations', $locations );
			}
		}
	}

	public function pizza_parlor_social_menu_1() {

		// ------- Create Social Menu --------
		$pizza_parlor_menuname = $pizza_parlor_themename . 'Social Menu 2';
		$pizza_parlor_menulocation = 'social-menu-1';
		$pizza_parlor_menu_exists = wp_get_nav_menu_object( $pizza_parlor_menuname );

		if( !$pizza_parlor_menu_exists){
			$pizza_parlor_menu_id = wp_create_nav_menu($pizza_parlor_menuname);

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Facebook', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.facebook.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Pinterest', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.pinterest.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Twitter', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.twitter.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Youtube', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.youtube.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Instagram', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.instagram.com',
				'menu-item-status' => 'publish',
			) );

			if( !has_nav_menu( $pizza_parlor_menulocation ) ){
					$locations = get_theme_mod('nav_menu_locations');
					$locations[$pizza_parlor_menulocation] = $pizza_parlor_menu_id;
					set_theme_mod( 'nav_menu_locations', $locations );
			}
		}
	}

	public function pizza_parlor_social_menu_2() {

		// ------- Create Social Menu --------
		$pizza_parlor_menuname = $pizza_parlor_themename . 'Social Menu 3';
		$pizza_parlor_menulocation = 'social-menu-2';
		$pizza_parlor_menu_exists = wp_get_nav_menu_object( $pizza_parlor_menuname );

		if( !$pizza_parlor_menu_exists){
			$pizza_parlor_menu_id = wp_create_nav_menu($pizza_parlor_menuname);

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Facebook', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.facebook.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Pinterest', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.pinterest.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Twitter', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.twitter.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Youtube', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.youtube.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Instagram', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.instagram.com',
				'menu-item-status' => 'publish',
			) );

			if( !has_nav_menu( $pizza_parlor_menulocation ) ){
					$locations = get_theme_mod('nav_menu_locations');
					$locations[$pizza_parlor_menulocation] = $pizza_parlor_menu_id;
					set_theme_mod( 'nav_menu_locations', $locations );
			}
		}
	}

	public function pizza_parlor_social_menu_3() {

		// ------- Create Social Menu --------
		$pizza_parlor_menuname = $pizza_parlor_themename . 'Social Menu 4';
		$pizza_parlor_menulocation = 'social-menu-3';
		$pizza_parlor_menu_exists = wp_get_nav_menu_object( $pizza_parlor_menuname );

		if( !$pizza_parlor_menu_exists){
			$pizza_parlor_menu_id = wp_create_nav_menu($pizza_parlor_menuname);

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Facebook', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.facebook.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Pinterest', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.pinterest.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Twitter', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.twitter.com',
				'menu-item-status' => 'publish',
			) );
	
			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Youtube', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.youtube.com',
				'menu-item-status' => 'publish',
			) );

			wp_update_nav_menu_item( $pizza_parlor_menu_id, 0, array(
				'menu-item-title'  => __( 'Instagram', 'pizza-parlor' ),
				'menu-item-url'    => 'https://www.instagram.com',
				'menu-item-status' => 'publish',
			) );

			if( !has_nav_menu( $pizza_parlor_menulocation ) ){
					$locations = get_theme_mod('nav_menu_locations');
					$locations[$pizza_parlor_menulocation] = $pizza_parlor_menu_id;
					set_theme_mod( 'nav_menu_locations', $locations );
			}
		}
	}

	/**
	* Imports the Demo Content
	* @since 1.1.0
	*/
	public function setup_widgets() {

		//................................................. MENU PAGES .................................................//
		
		$pizza_parlor_home_id='';
		$pizza_parlor_home_content = '';

		$pizza_parlor_home_title = 'Home';
		$pizza_parlor_home = array(
				'post_type' => 'page',
				'post_title' => $pizza_parlor_home_title,
				'post_content'  => $pizza_parlor_home_content,
				'post_status' => 'publish',
				'post_author' => 1,
				'post_slug' => 'home'
		);
		$pizza_parlor_home_id = wp_insert_post($pizza_parlor_home);

		//Set the home page template
		add_post_meta( $pizza_parlor_home_id, '_wp_page_template', 'revolution-home.php' );

		//Set the static front page
		$pizza_parlor_home = get_page_by_title( 'Home' );
		update_option( 'page_on_front', $pizza_parlor_home->ID );
		update_option( 'show_on_front', 'page' );


		// Create a posts page and assign the template
		$pizza_parlor_blog_title = 'Blog';
		$pizza_parlor_blog_check = get_page_by_path('blog');
		if (!$pizza_parlor_blog_check) {
			$pizza_parlor_blog = array(
				'post_type'    => 'page',
				'post_title'   => $pizza_parlor_blog_title,
				'post_status'  => 'publish',
				'post_author'  => 1,
				'post_name'    => 'blog' // Unique slug for the blog page
			);
			$pizza_parlor_blog_id = wp_insert_post($pizza_parlor_blog);

			// Set the posts page
			if (!is_wp_error($pizza_parlor_blog_id)) {
				update_option('page_for_posts', $pizza_parlor_blog_id);
			}
		}

		// Create a Contact page and assign the template
		$pizza_parlor_contact_title = 'Contact';
		$pizza_parlor_contact_check = get_page_by_path('contact');
		if (!$pizza_parlor_contact_check) {
			$pizza_parlor_contact = array(
				'post_type'    => 'page',
				'post_title'   => $pizza_parlor_contact_title,
				'post_content'   => '"More About The Free Pizza WordPress Theme"
										The Free Pizza WordPress Theme excels in providing a comprehensive set of tools tailored for pizza businesses. It supports responsive design, ensuring your website looks great on smartphones, tablets, and desktops alike, crucial for attracting customers who may be browsing on the go. The theme is optimized for SEO, helping your website rank well in search engine results and attract more organic traffic, essential for local businesses like pizza places. One of the standout features is its customizable menu options. Whether your specialty is New York style, Chicago style, Neapolitan, or gluten-free pizza, the theme allows you to showcase your menu items attractively. You can highlight pizza specials, create combos, and even offer customization options for customers to build their own pizzas through a user-friendly interface.

										Additionally, the Free Pizza WordPress Theme includes sections for testimonials, a banner area for promotions or featured items, and prominent call-to-action buttons strategically placed to encourage conversions like online orders or reservations. Social media integration is seamless, allowing you to connect with customers and share updates easily across various social networking platforms. Moreover, the Free Pizza WordPress Theme is built with optimized code for faster page load times, ensuring a smooth browsing experience for visitors. It’s designed to be developer-friendly, allowing for further customization and enhancements if needed. The clean code base also contributes to easier maintenance and scalability as your business grows. For operational efficiency, the Free Pizza WordPress Theme supports features like online ordering, delivery options, and reservation systems if integrated with compatible plugins.

										Furthermore, the Free Pizza WordPress Theme offers multiple layout options and color schemes to match your brand’s identity. Whether you prefer a classic look or a modern, vibrant style, you can customize the theme to suit your taste and appeal to your target audience effectively. It is also translation-ready, ensuring that the text on your website can be translated to various languages. This theme is an excellent choice for pizza businesses seeking a free, yet sophisticated online presence. With its responsive design, SEO optimization, customizable menu options, and marketing-friendly features, it empowers pizza restaurants to attract more customers, increase online visibility, and grow their business efficiently. Whether you’re starting a new pizza venture or refreshing your existing website, this theme provides the tools and flexibility needed to succeed in the competitive food service industry.',
					'post_status'  => 'publish',
				'post_author'  => 1,
				'post_name'    => 'contact' // Unique slug for the Contact page
			);
			wp_insert_post($pizza_parlor_contact);
		}

		// Create a Team page and assign the template
		$pizza_parlor_team_title = 'Team';
		$pizza_parlor_team_check = get_page_by_path('team');
		if (!$pizza_parlor_team_check) {
			$pizza_parlor_team = array(
				'post_type'    => 'page',
				'post_title'   => $pizza_parlor_team_title,
				'post_content'   => '"More About The Free Pizza WordPress Theme"
										The Free Pizza WordPress Theme excels in providing a comprehensive set of tools tailored for pizza businesses. It supports responsive design, ensuring your website looks great on smartphones, tablets, and desktops alike, crucial for attracting customers who may be browsing on the go. The theme is optimized for SEO, helping your website rank well in search engine results and attract more organic traffic, essential for local businesses like pizza places. One of the standout features is its customizable menu options. Whether your specialty is New York style, Chicago style, Neapolitan, or gluten-free pizza, the theme allows you to showcase your menu items attractively. You can highlight pizza specials, create combos, and even offer customization options for customers to build their own pizzas through a user-friendly interface.

										Additionally, the Free Pizza WordPress Theme includes sections for testimonials, a banner area for promotions or featured items, and prominent call-to-action buttons strategically placed to encourage conversions like online orders or reservations. Social media integration is seamless, allowing you to connect with customers and share updates easily across various social networking platforms. Moreover, the Free Pizza WordPress Theme is built with optimized code for faster page load times, ensuring a smooth browsing experience for visitors. It’s designed to be developer-friendly, allowing for further customization and enhancements if needed. The clean code base also contributes to easier maintenance and scalability as your business grows. For operational efficiency, the Free Pizza WordPress Theme supports features like online ordering, delivery options, and reservation systems if integrated with compatible plugins.

										Furthermore, the Free Pizza WordPress Theme offers multiple layout options and color schemes to match your brand’s identity. Whether you prefer a classic look or a modern, vibrant style, you can customize the theme to suit your taste and appeal to your target audience effectively. It is also translation-ready, ensuring that the text on your website can be translated to various languages. This theme is an excellent choice for pizza businesses seeking a free, yet sophisticated online presence. With its responsive design, SEO optimization, customizable menu options, and marketing-friendly features, it empowers pizza restaurants to attract more customers, increase online visibility, and grow their business efficiently. Whether you’re starting a new pizza venture or refreshing your existing website, this theme provides the tools and flexibility needed to succeed in the competitive food service industry.',
					'post_status'  => 'publish',
				'post_author'  => 1,
				'post_name'    => 'team' // Unique slug for the Team page
			);
			wp_insert_post($pizza_parlor_team);
		}

		// Create a Testimonial page and assign the template
		$pizza_parlor_testimonial_title = 'Testimonial';
		$pizza_parlor_testimonial_check = get_page_by_path('testimonial');
		if (!$pizza_parlor_testimonial_check) {
			$pizza_parlor_testimonial = array(
				'post_type'    => 'page',
				'post_title'   => $pizza_parlor_testimonial_title,
				'post_content'   => '"More About The Free Pizza WordPress Theme"
										The Free Pizza WordPress Theme excels in providing a comprehensive set of tools tailored for pizza businesses. It supports responsive design, ensuring your website looks great on smartphones, tablets, and desktops alike, crucial for attracting customers who may be browsing on the go. The theme is optimized for SEO, helping your website rank well in search engine results and attract more organic traffic, essential for local businesses like pizza places. One of the standout features is its customizable menu options. Whether your specialty is New York style, Chicago style, Neapolitan, or gluten-free pizza, the theme allows you to showcase your menu items attractively. You can highlight pizza specials, create combos, and even offer customization options for customers to build their own pizzas through a user-friendly interface.

										Additionally, the Free Pizza WordPress Theme includes sections for testimonials, a banner area for promotions or featured items, and prominent call-to-action buttons strategically placed to encourage conversions like online orders or reservations. Social media integration is seamless, allowing you to connect with customers and share updates easily across various social networking platforms. Moreover, the Free Pizza WordPress Theme is built with optimized code for faster page load times, ensuring a smooth browsing experience for visitors. It’s designed to be developer-friendly, allowing for further customization and enhancements if needed. The clean code base also contributes to easier maintenance and scalability as your business grows. For operational efficiency, the Free Pizza WordPress Theme supports features like online ordering, delivery options, and reservation systems if integrated with compatible plugins.

										Furthermore, the Free Pizza WordPress Theme offers multiple layout options and color schemes to match your brand’s identity. Whether you prefer a classic look or a modern, vibrant style, you can customize the theme to suit your taste and appeal to your target audience effectively. It is also translation-ready, ensuring that the text on your website can be translated to various languages. This theme is an excellent choice for pizza businesses seeking a free, yet sophisticated online presence. With its responsive design, SEO optimization, customizable menu options, and marketing-friendly features, it empowers pizza restaurants to attract more customers, increase online visibility, and grow their business efficiently. Whether you’re starting a new pizza venture or refreshing your existing website, this theme provides the tools and flexibility needed to succeed in the competitive food service industry.',
					'post_status'  => 'publish',
				'post_author'  => 1,
				'post_name'    => 'testimonial' // Unique slug for the Testimonial page
			);
			wp_insert_post($pizza_parlor_testimonial);
		}


		// ------------------------------------------ Slider Section -------------------------------------- //

			set_theme_mod('pizza_parlor_enable_slider',1);
			set_theme_mod('pizza_parlor_enable_project',1);

			set_theme_mod('pizza_parlor_site_title_text','Pizza Parlor');

			for($pizza_parlor_i=1;$pizza_parlor_i<=3;$pizza_parlor_i++){
				set_theme_mod( 'pizza_parlor_slider_image'.$pizza_parlor_i,get_template_directory_uri().'/revolution/assets/images/slider'.$pizza_parlor_i.'.png' );
				set_theme_mod( 'pizza_parlor_slider_heading'.$pizza_parlor_i, 'Classic Pizzas' );
				set_theme_mod( 'pizza_parlor_slider_text'.$pizza_parlor_i, 'Welcome to the Catering Services' );
				set_theme_mod( 'pizza_parlor_slider_button1_text'.$pizza_parlor_i, 'Read More' );
				set_theme_mod( 'pizza_parlor_slider_button1_link'.$pizza_parlor_i, '#' );
			}

		// ------------------------------------------ Chef Section -------------------------------------- //

			set_theme_mod('pizza_parlor_project_short_heading','Our Pizza Staff');
			set_theme_mod('pizza_parlor_project_heading','Our Special chef');
			
			set_theme_mod('pizza_parlor_project_box_heading_tab1', 'Wanda Maximoff');
			set_theme_mod('pizza_parlor_project_box_designation_tab1', 'Pizza Manager');
			set_theme_mod('pizza_parlor_project_box_text_tab1', 'Te obtinuit ut adepto satis somno. Aliisque institoribus iter deliciae vivet vita. Nam exempli gratia, quotiens ego vadam');

			set_theme_mod('pizza_parlor_project_box_heading_tab2', 'Tony Stark');
			set_theme_mod('pizza_parlor_project_box_designation_tab2', 'Head Chef');
			set_theme_mod('pizza_parlor_project_box_text_tab2', 'Te obtinuit ut adepto satis somno. Aliisque institoribus iter deliciae vivet vita. Nam exempli gratia, quotiens ego vadam');

			set_theme_mod('pizza_parlor_project_box_heading_tab_3', 'Peter Parker');
			set_theme_mod('pizza_parlor_project_box_designation_tab_3', 'Delivery Expert');
			set_theme_mod('pizza_parlor_project_box_text_tab_3', 'Te obtinuit ut adepto satis somno. Aliisque institoribus iter deliciae vivet vita. Nam exempli gratia, quotiens ego vadam');

			set_theme_mod('pizza_parlor_project_box_heading_tab_4', 'Natasha Romanoff');
			set_theme_mod('pizza_parlor_project_box_designation_tab_4', 'Customer Relations');
			set_theme_mod('pizza_parlor_project_box_text_tab_4', 'Te obtinuit ut adepto satis somno. Aliisque institoribus iter deliciae vivet vita. Nam exempli gratia, quotiens ego vadam');

			set_theme_mod( 'pizza_parlor_project_image_tab1',get_template_directory_uri().'/revolution/assets/images/chef1.png');
			set_theme_mod( 'pizza_parlor_project_image_tab2',get_template_directory_uri().'/revolution/assets/images/chef2.png');
			set_theme_mod( 'pizza_parlor_project_image_tab3',get_template_directory_uri().'/revolution/assets/images/chef3.png');
			set_theme_mod( 'pizza_parlor_project_image_tab4',get_template_directory_uri().'/revolution/assets/images/chef2.png');

		$this->pizza_parlor_social_menu();
		$this->pizza_parlor_social_menu_1();
		$this->pizza_parlor_social_menu_2();
		$this->pizza_parlor_social_menu_3();
		$this->pizza_parlor_customizer_nav_menu();
	}

	public function pizza_parlor_guide() {
		$display_string = '';
		$return = add_query_arg( array()) ;
		$theme = wp_get_theme( 'pizza-parlor' );
		?>
		<div class="wrapper-info get-stared-page-wrap">
			<div class="wrapper-info-content">
				<div class="buynow__">
					<h2><?php esc_html_e( 'Welcome to Pizza Parlor', 'pizza-parlor' ); ?> <span class="version">Version: <?php echo esc_html($theme['Version']);?></span></h2>
					<p><?php esc_html_e('The quick setup wizard will assist you in configuring your new website. This wizard will import the demo content.', 'pizza-parlor'); ?></p>
				</div>
				<div class="buynow_">
					<a target="_blank" class="buynow_themepage" href="<?php echo esc_url('https://www.revolutionwp.com/products/pizza-wordpress-theme'); ?>"><?php echo esc_html__('Go Premium Now', 'pizza-parlor'); ?></a>
				</div>
			</div>
			<div class="tab-sec theme-option-tab">
				<div id="demo_offer" class="tabcontent open">
					<?php $this->wizard_page(); ?>
				</div>
			</div>
		</div>
	<?php }
}