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: ''
Return Return
(string) Widget id including scheme/protocol.
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 );
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |