cache get_current_page_url
This commit is contained in:
parent
d167cb0a95
commit
536d71a5f6
|
@ -289,6 +289,13 @@ abstract class WC_Widget extends WP_Widget {
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*/
|
*/
|
||||||
protected function get_current_page_url() {
|
protected function get_current_page_url() {
|
||||||
|
$cache_key = 'woocommerce_widget_get_current_page_url';
|
||||||
|
$cached_value = (string) wp_cache_get( $cache_key, 'woocommerce' );
|
||||||
|
|
||||||
|
if ( $cached_value ) {
|
||||||
|
return apply_filters( 'woocommerce_widget_get_current_page_url', $cached_value, $this );
|
||||||
|
}
|
||||||
|
|
||||||
if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
|
if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
|
||||||
$link = home_url();
|
$link = home_url();
|
||||||
} elseif ( is_shop() ) {
|
} elseif ( is_shop() ) {
|
||||||
|
|
Loading…
Reference in New Issue