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

namespace SEOvaultSEO\Schema\Types;

use SEOvaultSEO\Schema\SchemaBase;

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

class WebPage extends SchemaBase {

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

	public function get() {
		return apply_filters(
			'seovaultseo_schema_type_webpage',
			array(
				array(
					'id'      => 'schema_name',
					'label'   => __( 'Schema Title', 'seovault-ai' ),
					'show'    => true,
					'default' => true,
					'type'    => 'Title',
					'std'     => 'WebPage',
				),
				array(
					'id'       => '@id',
					'type'     => 'Hidden',
					'std'      => '%current.url%#webpage',
					'required' => true,
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'       => 'name',
					'label'    => __( 'Name', 'seovault-ai' ),
					'required' => true,
					'std'      => '%current.title%',
					'type'     => 'Text',
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'      => 'description',
					'label'   => __( 'Description', 'seovault-ai' ),
					'default' => true,
					'show'    => true,
					'std'     => '%current.description%',
					'type'    => 'Text',
				),
				array(
					'id'       => 'url',
					'label'    => __( 'URL', 'seovault-ai' ),
					'required' => true,
					'std'      => '%current.url%',
					'type'     => 'Text',
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'      => 'isPartOf',
					'label'   => __( 'Part of', 'seovault-ai' ),
					'std'     => '%site.url%#website',
					'type'    => 'Text',
					'default' => true,
					'show'    => true,
				),
				array(
					'id'      => 'inLanguage',
					'label'   => __( 'Language', 'seovault-ai' ),
					'std'     => '%site.language%',
					'type'    => 'Text',
					'default' => true,
					'show'    => true,
				),
			)
		);
	}
}
