Yoast\WP\SEO\Bulk_Editor\User_Interface

Bulk_Editor_Integration::get_replacement_variables │ private │ Yoast 1.0

Builds the replacement variable data passed to the JS editor.

Mirrors Settings_Integration::get_replacement_variables() so the bulk editor's ReplacementVariableEditor receives the same variable metadata as the settings page.

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

Хуков нет.

Возвращает

array{variables: array<int, array<string, string|bool>>, recommended: array<string, string[]>, specific: array<string, string[]>, shared: string[]}. The replacement variable data.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_replacement_variables(): array;

Код Bulk_Editor_Integration::get_replacement_variables() Yoast 28.9

private function get_replacement_variables(): array {
	$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
	$specific_replace_vars    = new WPSEO_Admin_Editor_Specific_Replace_Vars();
	$replacement_variables    = $this->replace_vars->get_replacement_variables_with_labels();

	return [
		'variables'   => $replacement_variables,
		'recommended' => $recommended_replace_vars->get_recommended_replacevars(),
		'specific'    => $specific_replace_vars->get(),
		'shared'      => $specific_replace_vars->get_generic( $replacement_variables ),
	];
}