<?php

class Whizzie {

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

	public function init()
	{
		
	}

	public static function law_office_lite_setup_widgets(){

	set_theme_mod( 'law_office_lite_header_email', 'medical12@example.com' );
	set_theme_mod( 'law_office_lite_header_location_text', 'Location1234newyear' );
	set_theme_mod( 'law_office_lite_header_location_link', '#' );
	set_theme_mod( 'law_office_lite_header_phone_number', '1234567890' );
	set_theme_mod( 'law_office_lite_header_button_text', 'Consultaion' );
	set_theme_mod( 'law_office_lite_header_button_link', '#' );
	set_theme_mod('law_office_lite_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 */
            $law_office_lite_menuname  = 'Main Menus';
            $law_office_lite_location  = 'primary';

            $law_office_lite_menu = wp_get_nav_menu_object( $law_office_lite_menuname );

            if ( ! $law_office_lite_menu ) {
            $law_office_lite_menu_id = wp_create_nav_menu( $law_office_lite_menuname );

           // Home Page 
			wp_update_nav_menu_item( $law_office_lite_menu_id, 0, array(
				'menu-item-title'     => __( 'Home', 'law-office-lite' ),
				'menu-item-url'       => home_url( '/' ),
				'menu-item-type'      => 'custom',
				'menu-item-status'    => 'publish',
			) );

			// About Page 
			$law_office_lite_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 ( $law_office_lite_about_id ) {
			wp_update_nav_menu_item( $law_office_lite_menu_id, 0, array(
			'menu-item-title'     => 'About Us',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $law_office_lite_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
			) );
			}

			// Contact Page 
			$law_office_lite_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',
			'post_status' => 'publish',
			) );

			if ( $law_office_lite_about_id ) {
			wp_update_nav_menu_item( $law_office_lite_menu_id, 0, array(
			'menu-item-title'     => 'contact',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $law_office_lite_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
			) );
			}

			// Doctors Page 
			$law_office_lite_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'  => 'Doctors',
			'post_status' => 'publish',
			) );

			if ( $law_office_lite_about_id ) {
			wp_update_nav_menu_item( $law_office_lite_menu_id, 0, array(
			'menu-item-title'     => 'Doctors',
			'menu-item-object'    => 'page',
			'menu-item-object-id' => $law_office_lite_about_id,
			'menu-item-type'      => 'post_type',
			'menu-item-status'    => 'publish',
			) );
			}

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

                $vlaw_office_lite_blog_page_query = new WP_Query(array(
                    'post_type'      => 'page',
                    'name'           => sanitize_title($vlaw_office_lite_blog_page_title),
                    'post_status'    => 'publish',
                    'posts_per_page' => 1
                ));
                if (!$vlaw_office_lite_blog_page_query->have_posts()) {
                    $vlaw_office_lite_blog_page = array(
                        'post_type'   => 'page',
                        'post_title'  => $vlaw_office_lite_blog_page_title,
                        'post_status' => 'publish',
                        'post_author' => 1,
                    );
                    $vlaw_office_lite_blog_page_id = wp_insert_post($vlaw_office_lite_blog_page);
                    update_option('page_for_posts', $vlaw_office_lite_blog_page_id);

                    wp_update_nav_menu_item($vlaw_office_lite_menu_id, 0, array(
                        'menu-item-title'      => __('Blog', 'law-office-lite'),
                        'menu-item-url'        => get_permalink($vlaw_office_lite_blog_page_id),
                        'menu-item-status'     => 'publish',
                        'menu-item-object-id'  => $vlaw_office_lite_blog_page_id,
                        'menu-item-object'     => 'page',
                        'menu-item-type'       => 'post_type',
                    ));
                }
            
			/* Assign Menu Location */
			$law_office_lite_locations = get_theme_mod( 'nav_menu_locations', array() );
			$law_office_lite_locations[ $law_office_lite_location ] = $law_office_lite_menu_id;
			set_theme_mod( 'nav_menu_locations', $law_office_lite_locations );
		}
   }
}
 