HOME


Mini Shell 1.0
DIR: /home/depancom/www/depancomblogus/wp-content/themes/beautyspot/inc/
Upload File :
Current File : /home/depancom/www/depancomblogus/wp-content/themes/beautyspot/inc/actions.php
<?php

/**
 * GENERAL
 */

	// Load Google Fonts
	add_action( 'lsvr_beautyspot_load_assets', 'lsvr_beautyspot_load_google_fonts_css' );
	if ( ! function_exists( 'lsvr_beautyspot_load_google_fonts_css' ) ) {
		function lsvr_beautyspot_load_google_fonts_css() {

			if ( true === get_theme_mod( 'typography_google_fonts_enable', true ) ) {

				// Prepare query params
				$primary_font = get_theme_mod( 'typography_primary_font', 'Source+Sans+Pro' );
				$primary_font_variants = '400,400italic,600,600italic,700,700italic';
				$secondary_font = get_theme_mod( 'typography_secondary_font', 'Montserrat' );
				$secondary_font_variants = '400,400italic,700,700italic';
				$family_param = $primary_font !== $secondary_font ? $primary_font . ':' . $primary_font_variants . '|' . $secondary_font . ':' . $secondary_font_variants : $primary_font . ':' . $primary_font_variants;
				$subset = get_theme_mod( 'typography_font_subsets' );
				$subset_param = ! empty( $subset ) && is_string( $subset ) ? $subset : '';

				// Create query
				$query_args = array(
					'family' => $family_param,
					'subset' => $subset_param,
				);
				$query_args = array_filter( $query_args );

				// Enqueue fonts
				if ( ! empty( $query_args ) ) {
					wp_enqueue_style( 'lsvr-beautyspot-google-fonts', add_query_arg( $query_args, '//fonts.googleapis.com/css' ) );
				}

				// Primary font style
				$primary_font_elements = array( 'body', 'input', 'textarea', 'select', 'button', '#cancel-comment-reply-link', '.lsvr_listing-map__infobox' );
				$primary_font_family = str_replace( '+', ' ', $primary_font );
				$primary_font_css = implode( ', ', $primary_font_elements ) . ' { font-family: \'' . esc_attr( $primary_font_family ) . '\', Arial, sans-serif; }';
				wp_add_inline_style( 'lsvr-beautyspot-general-style', $primary_font_css );
				wp_add_inline_style( 'lsvr-beautyspot-general-style', 'html, body { font-size: ' . esc_attr( get_theme_mod( 'typography_base_font_size', '16' ) ) . 'px; }' );

				// Secondary font style
				if ( $primary_font !== $secondary_font ) {
					$secondary_font_elements = array( 'h1', 'h2', 'h3', 'h4', '.is-secondary-font', '.header-menu__item-link--level-0' );
					$secondary_font_family = str_replace( '+', ' ', $secondary_font );
					$secondary_font_css = implode( ', ', $secondary_font_elements ) . ' { font-family: \'' . esc_attr( $secondary_font_family ) . '\', Arial, sans-serif; }';
					wp_add_inline_style( 'lsvr-beautyspot-general-style', $secondary_font_css );
				}

			}

		}
	}

	// Load editor Google Fonts
	add_action( 'lsvr_beautyspot_load_editor_assets', 'lsvr_beautyspot_load_editor_google_fonts_css' );
	if ( ! function_exists( 'lsvr_beautyspot_load_editor_google_fonts_css' ) ) {
		function lsvr_beautyspot_load_editor_google_fonts_css() {

			if ( true === get_theme_mod( 'typography_google_fonts_enable', true ) ) {

				// Prepare query params
				$primary_font = get_theme_mod( 'typography_primary_font', 'Source+Sans+Pro' );
				$primary_font_variants = '400,400italic,600,600italic,700,700italic';
				$secondary_font = get_theme_mod( 'typography_secondary_font', 'Montserrat' );
				$secondary_font_variants = '400,400italic,700,700italic';
				$family_param = $primary_font !== $secondary_font ? $primary_font . ':' . $primary_font_variants . '|' . $secondary_font . ':' . $secondary_font_variants : $primary_font . ':' . $primary_font_variants;
				$subset = get_theme_mod( 'typography_font_subsets' );
				$subset_param = ! empty( $subset ) && is_string( $subset ) ? $subset : '';

				// Create query
				$query_args = array(
					'family' => $family_param,
					'subset' => $subset_param,
				);
				$query_args = array_filter( $query_args );

				// Enqueue fonts
				if ( ! empty( $query_args ) ) {
					wp_enqueue_style( 'lsvr-beautyspot-google-fonts', add_query_arg( $query_args, '//fonts.googleapis.com/css' ) );
				}

				// Primary font style
				$primary_font_elements = array( 'body .editor-styles-wrapper', '.editor-styles-wrapper', '.editor-styles-wrapper button' );
				$primary_font_family = str_replace( '+', ' ', $primary_font );
				$primary_font_css = implode( ', ', $primary_font_elements ) . ' { font-family: \'' . esc_attr( $primary_font_family ) . '\', Arial, sans-serif; }';
				wp_add_inline_style( 'lsvr-beautyspot-editor-style', $primary_font_css );
				wp_add_inline_style( 'lsvr-beautyspot-editor-style', 'body .editor-styles-wrapper, .editor-styles-wrapper { font-size: ' . esc_attr( get_theme_mod( 'typography_base_font_size', '16' ) ) . 'px; }' );

				// Secondary font style
				if ( $primary_font !== $secondary_font ) {
					$secondary_font_elements = array( '.editor-styles-wrapper h1', '.editor-styles-wrapper h2', '.editor-styles-wrapper h3', '.editor-styles-wrapper h4', '.editor-styles-wrapper .is-secondary-font' );
					$secondary_font_family = str_replace( '+', ' ', $secondary_font );
					$secondary_font_css = implode( ', ', $secondary_font_elements ) . ' { font-family: \'' . esc_attr( $secondary_font_family ) . '\', Arial, sans-serif; }';
					wp_add_inline_style( 'lsvr-beautyspot-editor-style', $secondary_font_css );
				}

			}

		}
	}

	// Set logo dimensions
	add_action( 'lsvr_beautyspot_load_assets', 'lsvr_beautyspot_set_logo_dimensions' );
	if ( ! function_exists( 'lsvr_beautyspot_set_logo_dimensions' ) ) {
		function lsvr_beautyspot_set_logo_dimensions() {

			$max_width = get_theme_mod( 'header_logo_max_width', 200 );
			if ( ! empty( $max_width ) ) {
				wp_add_inline_style( 'lsvr-beautyspot-general-style', '.header-logo { max-width: ' . esc_attr( $max_width ) . 'px; }' );
			}

		}
	}

	// Load skin CSS
	add_action( 'lsvr_beautyspot_load_assets', 'lsvr_beautyspot_load_skin_css' );
	if ( ! function_exists( 'lsvr_beautyspot_load_skin_css' ) ) {
		function lsvr_beautyspot_load_skin_css() {

			$version = wp_get_theme( 'beautyspot' );
			$version = $version->Version;

			// Load predefined color skin
			if ( 'predefined' === get_theme_mod( 'colors_method', 'predefined' ) || 'custom-colors' === get_theme_mod( 'colors_method', 'predefined' ) ) {
				$skin_file = get_theme_mod( 'colors_predefined_skin', 'default' );
				wp_enqueue_style( 'lsvr-beautyspot-color-scheme', get_template_directory_uri() . '/assets/css/skins/' . esc_attr( $skin_file ) . '.css', array( 'lsvr-beautyspot-general-style' ), $version );
			}

			// Generate CSS from custom colors
			if ( 'custom-colors' === get_theme_mod( 'colors_method', 'predefined' ) ) {
				wp_add_inline_style( 'lsvr-beautyspot-color-scheme', lsvr_beautyspot_get_custom_colors_css() );
			}

		}
	}

	// Load editor skin CSS
	add_action( 'lsvr_beautyspot_load_editor_assets', 'lsvr_beautyspot_load_editor_skin_css' );
	if ( ! function_exists( 'lsvr_beautyspot_load_editor_skin_css' ) ) {
		function lsvr_beautyspot_load_editor_skin_css() {

			$version = wp_get_theme( 'beautyspot' );
			$version = $version->Version;

			// Load predefined editor color skin
			if ( 'predefined' === get_theme_mod( 'colors_method', 'predefined' ) || 'custom-colors' === get_theme_mod( 'colors_method', 'predefined' ) ) {
				$skin_file = get_theme_mod( 'colors_predefined_skin', 'default' );
				wp_enqueue_style( 'lsvr-beautyspot-editor-color-scheme', get_template_directory_uri() . '/assets/css/skins/' . esc_attr( $skin_file ) . '.editor.css', array( 'lsvr-beautyspot-editor-style' ), $version );
			}

			// Generate CSS from custom colors
			if ( 'custom-colors' === get_theme_mod( 'colors_method', 'predefined' ) ) {
				wp_add_inline_style( 'lsvr-beautyspot-editor-color-scheme', lsvr_beautyspot_get_custom_colors_css( true ) );
			}

		}
	}

	// Load JS labels
	add_action( 'lsvr_beautyspot_load_assets', 'lsvr_beautyspot_load_js_labels' );
	if ( ! function_exists( 'lsvr_beautyspot_load_js_labels' ) ) {
		function lsvr_beautyspot_load_js_labels() {

			$js_labels = array(
				'previous_slide' => esc_html__( 'Previous slide', 'beautyspot' ),
				'next_slide' => esc_html__( 'Next slide', 'beautyspot' ),
			);

			// Magnific popup JS labels
			if ( true === apply_filters( 'lsvr_beautyspot_default_lightbox_enable', true ) ) {
				$js_labels[ 'magnific_popup' ] = array(
					'mp_tClose' => esc_html__( 'Close (Esc)', 'beautyspot' ),
					'mp_tLoading' => esc_html__( 'Loading...', 'beautyspot' ),
					'mp_tPrev' => esc_html__( 'Previous (Left arrow key)', 'beautyspot' ),
					'mp_tNext' => esc_html__( 'Next (Right arrow key)', 'beautyspot' ),
					'mp_image_tError' => esc_html__( 'The image could not be loaded.', 'beautyspot' ),
					'mp_ajax_tError' => esc_html__( 'The content could not be loaded.', 'beautyspot' ),
				);
			}

			// Apply filters
			$js_labels = array_merge( $js_labels, apply_filters( 'lsvr_beautyspot_add_js_labels', array() ) );

			// Convert to JS
			if ( ! empty( $js_labels ) ) {
				wp_add_inline_script( 'lsvr-beautyspot-main-scripts', 'var lsvr_beautyspot_js_labels = ' . json_encode( $js_labels ) );
			}

		}
	}

	// Load Masonry JS files
	add_action( 'lsvr_beautyspot_load_assets', 'lsvr_beautyspot_load_masonry_js' );
	if ( ! function_exists( 'lsvr_beautyspot_load_masonry_js' ) ) {
		function lsvr_beautyspot_load_masonry_js() {

			if ( is_page() ||
				( true === get_theme_mod( 'blog_archive_masonry_enable', false ) && lsvr_beautyspot_is_blog() && ! is_singular( 'post' ) ) ) {
				wp_enqueue_script( 'masonry' );
			}

		}
	}

	// Set current post type
	add_filter( 'lsvr_beautyspot_current_post_type', 'lsvr_beautyspot_blog_set_current_post_type' );
	if ( ! function_exists( 'lsvr_beautyspot_blog_set_current_post_type' ) ) {
		function lsvr_beautyspot_blog_set_current_post_type( $post_type ) {

			if ( lsvr_beautyspot_is_blog() ) {
				return 'post';
			}
			return $post_type;

		}
	}


/**
 * CORE
 */

	// Page header title
	add_filter( 'lsvr_beautyspot_page_header_title', 'lsvr_beautyspot_page_header_title' );
	if ( ! function_exists( 'lsvr_beautyspot_page_header_title' ) ) {
		function lsvr_beautyspot_page_header_title( $title ) {

			if ( is_category() || is_tax() ) {
				return single_term_title( '', false );
			}

			elseif ( lsvr_beautyspot_is_blog() && ! is_singular( 'post' ) ) {
				return lsvr_beautyspot_get_blog_archive_title();
			}

			elseif ( is_search() ) {
				return esc_html__( 'Search Results', 'beautyspot' );
			}

			elseif ( is_404() ) {
				return esc_html__( 'Page Not Found', 'beautyspot' );
			}

			else {
				return get_the_title();
			}

			return $title;

		}
	}

	// Get breadcrumbs
	add_filter( 'lsvr_beautyspot_breadcrumbs', 'lsvr_beautyspot_breadcrumbs' );
	if ( ! function_exists( 'lsvr_beautyspot_breadcrumbs' ) ) {
		function lsvr_beautyspot_breadcrumbs() {

			global $wp_query, $post;
			$breadcrumbs = [];

			// Home link
			$breadcrumbs[] = array(
				'url' => esc_url( home_url( '/' ) ),
				'label' => esc_html__( 'Home', 'beautyspot' ),
			);

			// Blog root for blog pages
			if ( get_option( 'page_for_posts' ) ) {
				$blog_root = array(
					'url' => get_permalink( get_option( 'page_for_posts' ) ),
					'label' => get_the_title( get_option( 'page_for_posts' ) ),
				);
			}
			else {
				$blog_root = array(
					'url' => esc_url( home_url( '/' ) ),
					'label' => esc_html__( 'Blog', 'beautyspot' ),
				);
			}

			// Blog
			if ( is_tag() || is_day() || is_month() || is_year() || is_author() || is_singular( 'post' ) ) {
				array_push( $breadcrumbs, $blog_root );
			}

			// Blog category
			else if ( is_category() ) {
				$breadcrumbs[] = $blog_root;
				$current_term = $wp_query->queried_object;
				$current_term_id = $current_term->term_id;
				$parent_ids = lsvr_beautyspot_get_term_parents( $current_term_id, 'category' );
				if ( ! empty( $parent_ids ) ) {
					foreach( $parent_ids as $parent_id ){
						$parent = get_term( $parent_id, 'category' );
						$breadcrumbs[] = array(
							'url' => get_term_link( $parent, 'category' ),
							'label' => $parent->name,
						);
					}
				}
			}

			// Regular page
			else if ( is_page() ) {
				$parent_id = $post->post_parent;
				$parents_arr = [];
				while ( $parent_id ) {
					$page = get_page( $parent_id );
					$parents_arr[] = array(
						'url' => get_permalink( $page->ID ),
						'label' => get_the_title( $page->ID ),
					);
					$parent_id = $page->post_parent;
				}
				$parents_arr = array_reverse( $parents_arr );
				foreach ( $parents_arr as $parent ) {
					$breadcrumbs[] = $parent;
				}
			}

			// Apply filters
			if ( ! empty( apply_filters( 'lsvr_beautyspot_add_to_breadcrumbs', array() ) ) ) {
				$breadcrumbs = array_merge( $breadcrumbs, apply_filters( 'lsvr_beautyspot_add_to_breadcrumbs', array() ) );
			}

			// Taxonomy
			if ( is_tax() ) {

				$taxonomy = get_query_var( 'taxonomy' );
				$term_parents = lsvr_beautyspot_get_term_parents( get_queried_object_id(), $taxonomy );
				if ( ! empty( $term_parents ) ) {
					foreach( $term_parents as $term_id ) {

						$term = get_term_by( 'id', $term_id, $taxonomy );
						$breadcrumbs[] = array(
							'url' => get_term_link( $term_id, $taxonomy ),
							'label' => $term->name,
						);

					}
				}
			}

			// Return breadcrumbs
			return $breadcrumbs;

		}
	}

	// Set blog archive layout
	add_filter( 'lsvr_beautyspot_blog_archive_layout', 'lsvr_beautyspot_blog_archive_layout' );
	if ( ! function_exists( 'lsvr_beautyspot_blog_archive_layout' ) ) {
		function lsvr_beautyspot_blog_archive_layout() {

			$path_prefix = 'template-parts/blog/archive-layout-';

			// Get layout from Customizer
			if ( ! empty( locate_template( $path_prefix . get_theme_mod( 'blog_archive_layout', 'default' ) . '.php' ) ) ) {
				return get_theme_mod( 'blog_archive_layout', 'default' );
			}

			// Default layout
			else {
				return 'default';
			}

		}
	}

	// Enable archive categories
	add_filter( 'lsvr_beautyspot_post_archive_categories_enable', 'lsvr_beautyspot_blog_archive_categories_enable' );
	if ( ! function_exists( 'lsvr_beautyspot_blog_archive_categories_enable' ) ) {
		function lsvr_beautyspot_blog_archive_categories_enable( $enabled ) {

			if ( lsvr_beautyspot_is_blog() && true === get_theme_mod( 'blog_archive_categories_enable', false ) ) {
				return true;
			}

			return $enabled;

		}
	}

	// Get categories taxonomy
	add_filter( 'lsvr_beautyspot_post_archive_categories_taxonomy', 'lsvr_beautyspot_blog_archive_categories_taxonomy' );
	if ( ! function_exists( 'lsvr_beautyspot_blog_archive_categories_taxonomy' ) ) {
		function lsvr_beautyspot_blog_archive_categories_taxonomy( $taxonomy ) {

			if ( lsvr_beautyspot_is_blog() ) {
				return 'category';
			}

			return $taxonomy;

		}
	}

	// Set page sidebar position
	add_filter( 'lsvr_beautyspot_sidebar_position', 'lsvr_beautyspot_sidebar_position' );
	if ( ! function_exists( 'lsvr_beautyspot_sidebar_position' ) ) {
		function lsvr_beautyspot_sidebar_position( $sidebar_position ) {

			// Is blog single
			if ( is_singular( 'post' ) ) {
				return get_theme_mod( 'blog_single_sidebar_position', 'right' );
			}

			// Is blog archive
			elseif ( lsvr_beautyspot_is_blog() ) {
				return get_theme_mod( 'blog_archive_sidebar_position', 'right' );
			}

			return $sidebar_position;

		}
	}

	// Set page sidebar ID
	add_filter( 'lsvr_beautyspot_sidebar_id', 'lsvr_beautyspot_sidebar_id' );
	if ( ! function_exists( 'lsvr_beautyspot_sidebar_id' ) ) {
		function lsvr_beautyspot_sidebar_id( $sidebar_id ) {

			// Page
			if ( is_page() ) {
				$page_id = ! empty( $page_id ) ? $page_id : get_the_ID();
				$sidebar_id = ! empty( $page_id ) ? get_post_meta( $page_id, 'lsvr_beautyspot_page_sidebar', true ) : false;

				if ( ! empty( $sidebar_id ) ) {
					$sidebar_id = $sidebar_id;
				} else {
					$sidebar_id = 'lsvr-beautyspot-default-sidebar';
				}
			}

			// Is blog single
			elseif ( is_singular( 'post' ) ) {
				$sidebar_id = get_theme_mod( 'blog_single_sidebar_id', 'lsvr-beautyspot-default-sidebar' );
			}

			// Is blog archive
			elseif ( lsvr_beautyspot_is_blog() ) {
				$sidebar_id = get_theme_mod( 'blog_archive_sidebar_id', 'lsvr-beautyspot-default-sidebar' );
			}

			// Default
			else {
				$sidebar_id = 'lsvr-beautyspot-default-sidebar';
			}

			return ! empty( $sidebar_id ) ? $sidebar_id : 'lsvr-beautyspot-default-sidebar';

		}
	}

	// Disable sidebars for narrow layouts
	add_filter( 'lsvr_beautyspot_sidebar_position', 'lsvr_beautyspot_narrow_layout_sidebar_position_disable', 20 );
	if ( ! function_exists( 'lsvr_beautyspot_narrow_layout_sidebar_position_disable' ) ) {
		function lsvr_beautyspot_narrow_layout_sidebar_position_disable( $sidebar_position ) {

			if ( true === apply_filters( 'lsvr_beautyspot_narrow_layout_enable', false ) ) {
				return 'disable';
			}

			return $sidebar_position;

		}
	}

	// Enable post single navigation
	add_filter( 'lsvr_beautyspot_post_single_navigation_enable', 'lsvr_beautyspot_blog_single_post_navigation_enable' );
	if ( ! function_exists( 'lsvr_beautyspot_blog_single_post_navigation_enable' ) ) {
		function lsvr_beautyspot_blog_single_post_navigation_enable( $enabled ) {

			if ( lsvr_beautyspot_is_blog() && true === get_theme_mod( 'blog_single_post_navigation_enable', true ) ) {
				return true;
			}

			return $enabled;

		}
	}


/**
 * META DATA
 */

	// Add breadcrumbs meta
	add_action( 'lsvr_beautyspot_breadcrumbs_bottom', 'lsvr_beautyspot_add_breadcrumbs_meta' );
	if ( ! function_exists( 'lsvr_beautyspot_add_breadcrumbs_meta' ) ) {
		function lsvr_beautyspot_add_breadcrumbs_meta() { ?>

			<!-- BREADCRUMBS META DATA : begin -->
			<script type="application/ld+json">
			{
				"@context": "http://schema.org",
				"@type": "BreadcrumbList",
				"itemListElement" : [
					<?php $i = 1;
					$breadcrumbs = apply_filters( 'lsvr_beautyspot_breadcrumbs', '' );
					foreach ( $breadcrumbs as $breadcrumb ) : ?>
					{
						"@type": "ListItem",
						"position": <?php echo esc_attr( $i ); ?>,
						"item": {
							"@id": "<?php echo esc_url( $breadcrumb['url'] ); ?>",
							"name": "<?php echo esc_attr( $breadcrumb['label'] ); ?>"
						}
					}<?php if ( $breadcrumb !== end( $breadcrumbs ) ) { echo ','; } ?>
					<?php $i++; endforeach; ?>
				]
			}
			</script>
			<!-- BREADCRUMBS META DATA : end -->

		<?php }
	}

	// Add blog post meta data
	add_action( 'lsvr_beautyspot_blog_single_bottom', 'lsvr_beautyspot_add_blog_single_meta' );
	if ( ! function_exists( 'lsvr_beautyspot_add_blog_single_meta' ) ) {
		function lsvr_beautyspot_add_blog_single_meta() { ?>

			<script type="application/ld+json">
			{
				"@context" : "http://schema.org",
				"@type" : "NewsArticle",
				"headline": "<?php echo esc_attr( get_the_title() ); ?>",
				"url" : "<?php echo esc_url( get_permalink() ); ?>",
				"mainEntityOfPage" : "<?php echo esc_url( get_permalink() ); ?>",
			 	"datePublished": "<?php echo esc_attr( get_the_time( 'c' ) ); ?>",
			 	"dateModified": "<?php echo esc_attr( get_the_modified_date( 'c' ) ); ?>",
			 	"description": "<?php echo esc_attr( get_the_excerpt() ); ?>",
			 	"author": {
			 		"@type" : "person",
			 		"name" : "<?php echo esc_attr( get_the_author() ); ?>",
			 		"url" : "<?php esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"
			 	},
			 	"publisher" : {
			 		"@id" : "<?php echo esc_url( home_url() ); ?>#WebSitePublisher"
			 	}

			 	<?php if ( lsvr_beautyspot_has_post_terms( get_the_ID(), 'post_tag' ) ) : ?>
				,"keywords": "<?php echo esc_attr( implode( ',', lsvr_beautyspot_get_post_term_names( get_the_ID(), 'post_tag' ) ) ); ?>"
			 	<?php endif; ?>

				<?php if ( has_post_thumbnail() ) : ?>
			 	,"image": {
			 		"@type" : "ImageObject",
			 		"url" : "<?php the_post_thumbnail_url( 'full' ); ?>",
			 		"width" : "<?php echo esc_attr( lsvr_beautyspot_get_image_width( get_post_thumbnail_id( get_the_ID() ), 'full' ) ); ?>",
			 		"height" : "<?php echo esc_attr( lsvr_beautyspot_get_image_height( get_post_thumbnail_id( get_the_ID() ), 'full' ) ); ?>",
			 		"thumbnailUrl" : "<?php the_post_thumbnail_url( 'thumbnail' ); ?>"
			 	}
			 	<?php endif; ?>

			}
			</script>

		<?php }
	}

	// Add site meta data
	add_action( 'wp_footer', 'lsvr_beautyspot_add_site_meta' );
	if ( ! function_exists( 'lsvr_beautyspot_add_site_meta' ) ) {
		function lsvr_beautyspot_add_site_meta() { ?>

			<?php // Get URLs of social links and email address
			$social_links = lsvr_beautyspot_get_social_links();
			if ( ! empty( $social_links->email ) ) {
				$email = ! empty( $social_links->email->url ) ? $social_links->email->url : '';
				unset( $social_links->email );
			} ?>

			<script type="application/ld+json">
			{
				"@context" : "http://schema.org",
				"@type" : "WebSite",
				"name" : "<?php bloginfo( 'name' ); ?>",
				"url" : "<?php echo esc_url( home_url() ); ?>",
				"description" : "<?php bloginfo( 'description' ); ?>",
			 	"publisher" : {

			 		"@id" : "<?php echo esc_url( home_url() ); ?>#WebSitePublisher",
			 		"@type" : "Organization",
			 		"name" : "<?php echo esc_attr( get_bloginfo('name') ); ?>",
			 		"url" : "<?php echo esc_url( home_url() ); ?>"

					<?php if ( ! empty( $email ) ) : ?>
					,"contactPoint": {
				 		"@type": "ContactPoint",
				 		"contactType": "customer service",
				 		"url": "<?php echo esc_url( home_url() ); ?>",
				 		"email": "<?php echo esc_attr( $email ); ?>"
				 	}
					<?php endif; ?>

			 		<?php if ( has_custom_logo() ) : ?>
			 		,"logo" : {
			 			"@type" : "ImageObject",
			 			"url" : "<?php echo esc_url( lsvr_beautyspot_get_image_url( get_theme_mod( 'custom_logo' ) ) ); ?>",
						"width" : "<?php echo esc_attr( lsvr_beautyspot_get_image_width( get_theme_mod( 'custom_logo' ) ) ); ?>",
						"height" : "<?php echo esc_attr( lsvr_beautyspot_get_image_height( get_theme_mod( 'custom_logo' ) ) ); ?>"
			 		}
			 		<?php endif; ?>

					<?php if ( ! empty( $social_links ) ) : ?>
					,"sameAs" : [
						<?php foreach( $social_links as $social ) : if ( ! empty( $social->url ) ) : ?>
				    		"<?php echo esc_url( $social->url ); ?>"<?php if ( $social !== end( $social_links ) ) { echo ','; } ?>
						<?php endif; endforeach; ?>
				  	]
				  	<?php endif; ?>

			 	},
			 	"potentialAction": {
			    	"@type" : "SearchAction",
			    	"target" : "<?php echo esc_url( home_url() ); ?>/?s={search_term}",
			    	"query-input": "required name=search_term"
			    }
			}
			</script>

		<?php }
	}

?>