ACF\AI\GEO

GEO::render_post_type_schema_tabpublicACF 6.8.0

Render "Schema" tab content for post types

Method of the class: GEO{}

No Hooks.

Returns

null. Nothing (null).

Usage

$GEO = new GEO();
$GEO->render_post_type_schema_tab( $acf_post_type );
$acf_post_type(array) (required)
The ACF post type data.

Changelog

Since 6.8.0 Introduced.

GEO::render_post_type_schema_tab() code ACF 6.8.8

<?php
public function render_post_type_schema_tab( $acf_post_type ) {
	?>
	<span class="acf-experimental-badge acf-field"><?php esc_html_e( 'Experimental', 'acf' ); ?></span>
	<?php
	// Add post-type-specific field: auto JSON-LD.
	acf_render_field_wrap(
		array(
			'type'         => 'true_false',
			'name'         => 'auto_jsonld',
			'key'          => 'auto_jsonld',
			'prefix'       => 'acf_post_type',
			'value'        => $acf_post_type['auto_jsonld'] ?? 0,
			'label'        => __( 'Automatically add JSON-LD data for fields on this post type', 'acf' ),
			'instructions' => __( 'When enabled, ACF field data will be automatically included as JSON-LD structured data in the page head for better SEO and semantic markup.', 'acf' ),
			'ui'           => true,
			'default'      => 0,
		)
	);

	// Add post-type-specific field: schema type.
	acf_render_field_wrap(
		array(
			'type'         => 'select',
			'name'         => 'schema_type',
			'key'          => 'schema_type',
			'prefix'       => 'acf_post_type',
			'value'        => $acf_post_type['schema_type'] ?? '',
			'label'        => __( 'Schema.org Type', 'acf' ),
			'instructions' => __( 'The Schema.org @type for JSON-LD output. By default, the type is automatically detected based on the schema properties assigned to your fields. You can assign additional types here. Select multiple types if needed (e.g., Recipe + Article).', 'acf' ),
			'choices'      => $this->get_schema_types(),
			'default'      => '',
			'allow_null'   => 1,
			'multiple'     => 1,
			'ui'           => 1,
		),
		'div',
		'field'
	);
}