Check SHOP_IS_ON_FRONT existence before defining it

This commit is contained in:
Frédéric Demarle 2017-01-29 21:32:26 +01:00
parent abe87d9bfa
commit e03000126e
1 changed files with 3 additions and 1 deletions

View File

@ -285,7 +285,9 @@ class WC_Query {
}
// Define a variable so we know this is the front page shop later on
define( 'SHOP_IS_ON_FRONT', true );
if ( ! defined( 'SHOP_IS_ON_FRONT' ) ) {
define( 'SHOP_IS_ON_FRONT', true );
}
// Get the actual WP page to avoid errors and let us use is_front_page()
// This is hacky but works. Awaiting https://core.trac.wordpress.org/ticket/21096