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

namespace SEOvaultSEO\Schema\Types;

use SEOvaultSEO\Schema\SchemaBase;

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

class SearchAction extends SchemaBase {

	public function schema_data() {
		return array(
			'title'   => 'SearchAction',
			'type'    => 'SearchAction',
			'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_searchaction',
			array(
				array(
					'id'      => 'schema_name',
					'label'   => __( 'Schema Title', 'seovault-ai' ),
					'show'    => true,
					'default' => true,
					'type'    => 'Title',
					'std'     => 'SearchAction',
				),
				array(
					'id'       => '@id',
					'type'     => 'Hidden',
					'std'      => '%site.url%#searchaction',
					'required' => true,
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'       => 'target',
					'type'     => 'Hidden',
					'required' => true,
					'default'  => true,
					'show'     => true,
					'std'      => '%site.search_url%',
				),
				array(
					'id'       => 'query-input',
					'type'     => 'Hidden',
					'required' => true,
					'default'  => true,
					'show'     => true,
					'std'      => 'required name=search_term_string',
				),
			)
		);
	}
}
