WC_Widget::get_widget_id_for_cache()protectedWC 3.4.0

Get widget id plus scheme/protocol to prevent serving mixed content from (persistently) cached widgets.

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

Хуки из метода

Возвращает

Строку. Widget id including scheme/protocol.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_widget_id_for_cache( $widget_id, $scheme );
$widget_id(строка) (обязательный)
Id of the cached widget.
$scheme(строка)
Scheme for the widget id.
По умолчанию: ''

Список изменений

С версии 3.4.0 Введена.

Код WC_Widget::get_widget_id_for_cache() WC 8.7.0

protected function get_widget_id_for_cache( $widget_id, $scheme = '' ) {
	if ( $scheme ) {
		$widget_id_for_cache = $widget_id . '-' . $scheme;
	} else {
		$widget_id_for_cache = $widget_id . '-' . ( is_ssl() ? 'https' : 'http' );
	}

	return apply_filters( 'woocommerce_cached_widget_id', $widget_id_for_cache );
}