Yoast\WP\SEO\Generators
Schema_Generator::get_type_from_piece() private Yoast 1.0
Retrieves the type from a graph piece.
{} Это метод класса: Schema_Generator{}
Хуков нет.
Возвращает
Массив. An array of the piece's types.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_type_from_piece( $piece );
- $piece(массив) (обязательный)
- The graph piece.
Код Schema_Generator::get_type_from_piece() Schema Generator::get type from piece Yoast 15.6.2
private function get_type_from_piece( $piece ) {
if ( isset( $piece['@type'] ) ) {
if ( \is_array( $piece['@type'] ) ) {
return $piece['@type'];
}
return [ $piece['@type'] ];
}
return [];
}