Yoast\WP\SEO\Generators\Schema

HowTo::add_step_image()privateYoast 1.0

Checks if we have a step image, if we do, add it.

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

Хуков нет.

Возвращает

null. Ничего (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() Yoast 22.4

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'] ) );
			}
		}
	}
}