WC_Widget::get_widget_id_for_cache( string $widget_id, string $scheme = '' )

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


Description Description


Parameters Parameters

$widget_id

(Required) Id of the cached widget.

$scheme

(Optional) Scheme for the widget id.

Default value: ''


Top ↑

Return Return

(string) Widget id including scheme/protocol.


Top ↑

Source Source

File: includes/abstracts/abstract-wc-widget.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.4.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.