Automattic\WooCommerce\EmailEditor\Engine
Personalizer::get_callback_context
Build the context array passed to a tag callback, exposing the rendering context of the current replacement site under the reserved key.
Метод класса: Personalizer{}
Хуков нет.
Возвращает
array<string, mixed>. The callback context.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_callback_context( $rendering_context ): array;
- $rendering_context(строка) (обязательный)
- One of the RENDERING_CONTEXT_* constants.
Код Personalizer::get_callback_context() Personalizer::get callback context WC 11.2.2
private function get_callback_context( string $rendering_context ): array {
// array_replace() (unlike array_merge()) preserves integer keys in the consumer's context.
return array_replace( $this->context, array( self::RENDERING_CONTEXT_KEY => $rendering_context ) );
}