Yoast\WP\SEO\Generators\Schema
HowTo::add_step_image()
Checks if we have a step image, if we do, add it.
Метод класса: HowTo{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// private - только в коде основоного (родительского) класса $result = $this->add_step_image( $schema_step, $step );
- $schema_step(массив) (обязательный) (передается по ссылке — &)
- Our Schema output for the Step.
- $step(массив) (обязательный)
- The step block data.
Код HowTo::add_step_image() HowTo::add step image Yoast 20.7
private function add_step_image( &$schema_step, $step ) { if ( isset( $step['text'] ) && is_array( $step['text'] ) ) { foreach ( $step['text'] as $line ) { if ( \is_array( $line ) && isset( $line['type'] ) && $line['type'] === 'img' ) { $schema_step['image'] = $this->get_image_schema( \esc_url( $line['props']['src'] ) ); } } } }