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

namespace SEOvaultSEO\Schema\Types;

use SEOvaultSEO\Schema\SchemaBase;

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

class Person extends SchemaBase {

	public function schema_data() {
		return array(
			'title'   => 'Person',
			'type'    => 'Person',
			'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_person',
			array(
				array(
					'id'       => '@id',
					'type'     => 'Hidden',
					'std'      => '%site.url%#person',
					'required' => true,
					'default'  => true,
					'show'     => false,
				),
				array(
					'id'      => 'schema_name',
					'label'   => __( 'Schema Title', 'seovault-ai' ),
					'show'    => true,
					'default' => true,
					'type'    => 'Title',
					'std'     => 'Person',
				),
				array(
					'id'       => 'name',
					'label'    => __( 'Name', 'seovault-ai' ),
					'required' => true,
					'std'      => '%author.name%',
					'type'     => 'Text',
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'      => 'url',
					'label'   => __( 'URL', 'seovault-ai' ),
					'std'     => '%site.url%',
					'type'    => 'Text',
					'default' => true,
					'show'    => true,
				),
			)
		);
	}
}
