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

namespace SEOvaultSEO\Schema\Types;

use SEOvaultSEO\Schema\SchemaBase;

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

class BreadcrumbList extends SchemaBase {

	public function schema_data() {
		return array(
			'title'       => 'BreadcrumbList',
			'type'        => 'BreadcrumbList',
			'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_breadcrumblist',
			array(
				array(
					'id'      => 'schema_name',
					'label'   => __( 'Schema Title', 'seovault-ai' ),
					'show'    => true,
					'default' => true,
					'type'    => 'Title',
					'std'     => 'BreadcrumbList',
				),
				array(
					'id'       => 'name',
					'std'      => 'BreadcrumbList',
					'type'     => 'Hidden',
					'required' => true,
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'       => '@id',
					'type'     => 'Hidden',
					'std'      => '%current.url%#breadcrumblist',
					'required' => true,
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'       => '@type',
					'std'      => 'BreadcrumbList',
					'type'     => 'Hidden',
					'required' => true,
					'default'  => true,
					'show'     => true,
				),
				array(
					'id'       => 'itemListElement',
					'type'     => 'Hidden',
					'std'      => '%current.breadcrumbs%',
					'required' => true,
					'default'  => true,
					'show'     => true,
				),
			)
		);
	}
}
