Pass scheme without hyphen

This commit is contained in:
Mike Jolley 2018-05-09 17:06:34 +01:00
parent 424213bc17
commit 14cbf7b0f0
1 changed files with 3 additions and 3 deletions

View File

@ -117,7 +117,7 @@ abstract class WC_Widget extends WP_Widget {
* Flush the cache.
*/
public function flush_widget_cache() {
foreach ( array( '-https', '-http' ) as $scheme ) {
foreach ( array( 'https', 'http' ) as $scheme ) {
wp_cache_delete( $this->get_widget_id_for_cache( $this->widget_id, $scheme ), 'widget' );
}
}
@ -360,9 +360,9 @@ abstract class WC_Widget extends WP_Widget {
*/
protected function get_widget_id_for_cache( $widget_id, $scheme = '' ) {
if ( $scheme ) {
$widget_id_for_cache = $widget_id . $scheme;
$widget_id_for_cache = $widget_id . '-' . $scheme;
} else {
$widget_id_for_cache = $widget_id . ( is_ssl() ? '-https' : '-http' );
$widget_id_for_cache = $widget_id . '-' . ( is_ssl() ? 'https' : 'http' );
}
return apply_filters( 'woocommerce_cached_widget_id', $widget_id_for_cache );