Tribe__JSON_LD__Abstract::set_type( $post,  $type )

Register the current $type to prevent duplicates entries with different $types and IDs


Parameters

$post

(Required)

$type

(Required)


Top ↑

Return

(mixed)


Top ↑

Source

File: src/Tribe/JSON_LD/Abstract.php

	public function set_type( $post, $type ) {
		$id = Tribe__Main::post_id_helper( $post );

		if ( $this->type_exists( $id, $type ) ) {
			return self::$types[ $id ];
		}

		if ( empty( self::$types[ $id ] ) ) {
			self::$types[ $id ] = array( $this->type );
		} else {
			self::$types[ $id ][] = $this->type;
		}

		return self::$types[ $id ];
	}

Top ↑

Changelog

Changelog
Version Description
4.7.12 Introduced.