<?php
/**
 * WebSite Schema Type
 *
 * @package SEOvaultSEO\Schema\Types
 */

namespace SEOvaultSEO\Schema\Types;

use SEOvaultSEO\Schema\SchemaBase;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class WebSite extends SchemaBase {

	public function schema_data() {
		return array(
			'title'   => 'WebSite',
			'type'    => 'WebSite',
			'show_on' => array(
				'rules'        => array( 'basic-global' ),
				'specific'     => array(),
				'specificText' => array(),
			),
			'fields'  => $this->parse_fields( $this->get() ),
		);
	}

	public function get() {
		return apply_filters(
			'seovaultseo_schema_type_website',
			array(
				array(
					'id'       => '@id',
					'type'     => 'Hidden',
					'std'      => '%site.url%#website',
					'required' => true,
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'      => 'schema_name',
					'label'   => __( 'Schema Title', 'seovault-ai' ),
					'show'    => true,
					'default' => true,
					'type'    => 'Title',
					'std'     => 'WebSite',
				),
				array(
					'id'       => 'name',
					'label'    => __( 'Name', 'seovault-ai' ),
					'required' => true,
					'std'      => '%site.title%',
					'type'     => 'Text',
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'      => 'description',
					'label'   => __( 'Description', 'seovault-ai' ),
					'default' => true,
					'show'    => true,
					'std'     => '%site.description%',
					'type'    => 'Text',
				),
				array(
					'id'       => 'url',
					'label'    => __( 'URL', 'seovault-ai' ),
					'required' => true,
					'std'      => '%site.url%',
					'type'     => 'Text',
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'      => 'potentialAction',
					'label'   => __( 'Search Action', 'seovault-ai' ),
					'std'     => '%schemas.searchaction%',
					'type'    => 'Text',
					'default' => true,
					'show'    => true,
				),
				array(
					'id'      => 'publisher',
					'label'   => __( 'Publisher', 'seovault-ai' ),
					'std'     => '%schemas.organization%',
					'default' => true,
					'show'    => true,
					'type'    => 'Text',
				),
				array(
					'id'      => 'inLanguage',
					'label'   => __( 'Language', 'seovault-ai' ),
					'std'     => '%site.language%',
					'type'    => 'Text',
					'default' => true,
					'show'    => true,
				),
			)
		);
	}
}
