Yoast\WP\SEO\Helpers\Schema
Replace_Vars_Helper::replace()
Replaces the variables.
Метод класса: Replace_Vars_Helper{}
Хуков нет.
Возвращает
Массив
. The array with replaced vars.
Использование
$Replace_Vars_Helper = new Replace_Vars_Helper(); $Replace_Vars_Helper->replace( $schema_data, $presentation );
- $schema_data(массив) (обязательный)
- The Schema data.
- $presentation(Indexable_Presentation) (обязательный)
- The indexable presentation.
Код Replace_Vars_Helper::replace() Replace Vars Helper::replace Yoast 24.4
public function replace( array $schema_data, Indexable_Presentation $presentation ) { foreach ( $schema_data as $key => $value ) { if ( \is_array( $value ) ) { $schema_data[ $key ] = $this->replace( $value, $presentation ); continue; } $schema_data[ $key ] = $this->replace_vars->replace( $value, $presentation->source ); } return $schema_data; }