WooCommerce::init_customizer
Initialize the customizer on the plugins_loaded action. If WooCommerce is network activated, wp_is_block_theme() will be called too early, which cause the warning in #58364. By initializing the customizer on plugins_loaded, we ensure that wp_is_block_theme() is called after theme directories registration.
Method of the class: WooCommerce{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WooCommerce = new WooCommerce(); $WooCommerce->init_customizer();
Notes
WooCommerce::init_customizer() WooCommerce::init customizer code WC 10.7.0
public function init_customizer() {
global $pagenow;
if (
'customize.php' === $pagenow ||
isset( $_REQUEST['customize_theme'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended
! wp_is_block_theme()
) {
new WC_Shop_Customizer();
}
}