<?php

class Whizzie {

	public function __construct() {
		$this->init();
	}

	public function init()
	{
	
	}

	public static function elemento_it_solutions_setup_widgets(){

		set_theme_mod( 'elemento_it_solutions_header_hiring_head', 'We are hiring ' );
		set_theme_mod( 'elemento_it_solutions_header_hiring', ' Are you a motiveted IT Suppot Engineer' );
		set_theme_mod( 'elemento_it_solutions_header_hiring_url', '#' );
		set_theme_mod( 'elemento_it_solutions_header_hiring_text', 'Register Now' );

		set_theme_mod( 'elemento_it_solutions_header_location', '1234 Mignal Hill Road California' );
		set_theme_mod( 'elemento_it_solutions_header_email', 'businessconsultin@mail.com' );

		set_theme_mod( 'elemento_it_solutions_header_phone_number', '+123456789' );
		set_theme_mod( 'elemento_it_solutions_header_phone_number_text', 'Need Help ? Talk to an expert' );

		set_theme_mod('elemento_it_solutions_social_links_settings', array(
            array(
                "link_text" => "fab fa-instagram",
                "link_url" => "www.instagram.com"
            ),
            array(
                "link_text" => "fab fa-twitter",
                "link_url" => "www.twitter.com"
            ),
            array(
                "link_text" => "fab fa-youtube",
                "link_url" => "www.youtube.com"
            ),
            array(
                "link_text" => "fab fa-linkedin-in",
                "link_url" => "www.linkedin.com"
            )
        ));

        /* Create Menu */
            $elemento_it_solutions_menuname  = 'Main Menu';
            $elemento_it_solutions_location  = 'main-menu';

            $elemento_it_solutions_menu = wp_get_nav_menu_object( $elemento_it_solutions_menuname );

            if ( ! $elemento_it_solutions_menu ) {
            $elemento_it_solutions_menu_id = wp_create_nav_menu( $elemento_it_solutions_menuname );

           // Home Page 
			wp_update_nav_menu_item( $elemento_it_solutions_menu_id, 0, array(
				'menu-item-title'     => __( 'Home', 'elemento-it-solutions' ),
				'menu-item-url'       => home_url( '/' ),
				'menu-item-type'      => 'custom',
				'menu-item-status'    => 'publish',
				'menu-item-position'  => 1,
			) );

			// About Us Page 
			$elemento_it_solutions_about_id = wp_insert_post( array(
			'post_type'   => 'page',
			'post_content' => 'We are committed to providing reliable, professional, and result-oriented solutions tailored to meet individual needs. Our goal is to empower people with the right guidance, knowledge, and support to help them make informed decisions for a better future. <br><br> Our mission is to deliver high-quality services with honesty, transparency, and dedication. We focus on understanding client requirements and offering practical solutions that create long-term value. <br><br> With a client-centric approach, experienced professionals, and a commitment to excellence, we ensure every individual receives the attention and guidance they deserve. We believe in building trust through quality service and consistent results.',
			'post_title'  => 'About Us',
			'post_status' => 'publish',
			) );

			if ( $elemento_it_solutions_about_id ) {
			wp_update_nav_menu_item( $elemento_it_solutions_menu_id, 0, array(
			'menu-item-title'     => 'About Us',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $elemento_it_solutions_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
            'menu-item-position'  => 2,
			) );
			}

			// Services Page 
			$elemento_it_solutions_about_id = wp_insert_post( array(
			'post_type'   => 'page',
			'post_content' => 'We are committed to providing reliable, professional, and result-oriented solutions tailored to meet individual needs. Our goal is to empower people with the right guidance, knowledge, and support to help them make informed decisions for a better future. <br><br> Our mission is to deliver high-quality services with honesty, transparency, and dedication. We focus on understanding client requirements and offering practical solutions that create long-term value. <br><br> With a client-centric approach, experienced professionals, and a commitment to excellence, we ensure every individual receives the attention and guidance they deserve. We believe in building trust through quality service and consistent results.',
			'post_title'  => 'Services',
			'post_status' => 'publish',
			) );

			if ( $elemento_it_solutions_about_id ) {
			wp_update_nav_menu_item( $elemento_it_solutions_menu_id, 0, array(
			'menu-item-title'     => 'Services',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $elemento_it_solutions_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
            'menu-item-position'  => 3,
			) );
			}

            // Portfolio Page 
			$elemento_it_solutions_about_id = wp_insert_post( array(
			'post_type'   => 'page',
			'post_content' => 'We are committed to providing reliable, professional, and result-oriented solutions tailored to meet individual needs. Our goal is to empower people with the right guidance, knowledge, and support to help them make informed decisions for a better future. <br><br> Our mission is to deliver high-quality services with honesty, transparency, and dedication. We focus on understanding client requirements and offering practical solutions that create long-term value. <br><br> With a client-centric approach, experienced professionals, and a commitment to excellence, we ensure every individual receives the attention and guidance they deserve. We believe in building trust through quality service and consistent results.',
			'post_title'  => 'Portfolio',
			'post_status' => 'publish',
			) );

			if ( $elemento_it_solutions_about_id ) {
			wp_update_nav_menu_item( $elemento_it_solutions_menu_id, 0, array(
			'menu-item-title'     => 'Portfolio',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $elemento_it_solutions_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
            'menu-item-position'  => 3,
			) );
			}

			// Contact Us Page 
			$elemento_it_solutions_about_id = wp_insert_post( array(
			'post_type'   => 'page',
			'post_content' => 'We are committed to providing reliable, professional, and result-oriented solutions tailored to meet individual needs. Our goal is to empower people with the right guidance, knowledge, and support to help them make informed decisions for a better future. <br><br> Our mission is to deliver high-quality services with honesty, transparency, and dedication. We focus on understanding client requirements and offering practical solutions that create long-term value. <br><br> With a client-centric approach, experienced professionals, and a commitment to excellence, we ensure every individual receives the attention and guidance they deserve. We believe in building trust through quality service and consistent results.',
			'post_title'  => 'Contact Us',
			'post_status' => 'publish',
			) );

			if ( $elemento_it_solutions_about_id ) {
			wp_update_nav_menu_item( $elemento_it_solutions_menu_id, 0, array(
			'menu-item-title'     => 'Contact Us',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $elemento_it_solutions_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
            'menu-item-position'  => 4,
			) );
			}

			// Pages Page 
			$elemento_it_solutions_about_id = wp_insert_post( array(
			'post_type'   => 'page',
			'post_content' => 'We are committed to providing reliable, professional, and result-oriented solutions tailored to meet individual needs. Our goal is to empower people with the right guidance, knowledge, and support to help them make informed decisions for a better future. <br><br> Our mission is to deliver high-quality services with honesty, transparency, and dedication. We focus on understanding client requirements and offering practical solutions that create long-term value. <br><br> With a client-centric approach, experienced professionals, and a commitment to excellence, we ensure every individual receives the attention and guidance they deserve. We believe in building trust through quality service and consistent results.',
			'post_title'  => 'Pages',
			'post_status' => 'publish',
			) );

			if ( $elemento_it_solutions_about_id ) {
			wp_update_nav_menu_item( $elemento_it_solutions_menu_id, 0, array(
			'menu-item-title'     => 'Pages',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $elemento_it_solutions_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
            'menu-item-position'  => 4,
			) );
			}

           // Create Blog Page
                $elemento_it_solutions_blog_page_title = 'Blog';

                $elemento_it_solutions_blog_page_query = new WP_Query(array(
                    'post_type'      => 'page',
                    'name'           => sanitize_title($elemento_it_solutions_blog_page_title),
                    'post_status'    => 'publish',
                    'posts_per_page' => 1
                ));
                if (!$elemento_it_solutions_blog_page_query->hae_posts()) {
                    $elemento_it_solutions_blog_page = array(
                        'post_type'   => 'page',
                        'post_title'  => $elemento_it_solutions_blog_page_title,
                        'post_status' => 'publish',
                        'post_author' => 1,
                    );
                    $elemento_it_solutions_blog_page_id = wp_insert_post($elemento_it_solutions_blog_page);
                    update_option('page_for_posts', $elemento_it_solutions_blog_page_id);

                    wp_update_na_menu_item($elemento_it_solutions_menu_id, 0, array(
                        'menu-item-title'      => __('Blog', 'elemento-it-solutions'),
                        'menu-item-url'        => get_permalink($elemento_it_solutions_blog_page_id),
                        'menu-item-status'     => 'publish',
                        'menu-item-object-id'  => $elemento_it_solutions_blog_page_id,
                        'menu-item-object'     => 'page',
                        'menu-item-type'       => 'post_type',
                    ));
                }
            
			/* ---------- Assign Menu Location ---------- */
			$elemento_it_solutions_locations = get_theme_mod( 'nav_menu_locations', array() );
			$elemento_it_solutions_locations[ $elemento_it_solutions_location ] = $elemento_it_solutions_menu_id;
			set_theme_mod( 'nav_menu_locations', $elemento_it_solutions_locations );
		}

	}
}
 