Yoast\WP\SEO\Generators
Schema_Generator::get_type_from_piece()
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 24.3
private function get_type_from_piece( $piece ) { if ( isset( $piece['@type'] ) ) { if ( \is_array( $piece['@type'] ) ) { // Return as-is, but remove unusable values, like sub-arrays, objects, null. return \array_filter( $piece['@type'], 'is_string' ); } return [ $piece['@type'] ]; } return []; }