Yoast\WP\SEO\Generators

Breadcrumbs_Generator::get_taxonomy_post_type_parent()protectedYoast 1.0

Returns the post type parent of a given taxonomy.

Метод класса: Breadcrumbs_Generator{}

Хуков нет.

Возвращает

Строку|false. The parent if it exists, false otherwise.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_taxonomy_post_type_parent( $taxonomy );
$taxonomy(строка) (обязательный)
The taxonomy.

Код Breadcrumbs_Generator::get_taxonomy_post_type_parent() Yoast 22.4

protected function get_taxonomy_post_type_parent( $taxonomy ) {
	$parent = $this->options->get( 'taxonomy-' . $taxonomy . '-ptparent' );

	if ( empty( $parent ) || (string) $parent === '0' ) {
		return false;
	}

	return $parent;
}