Only run "woocommerce_admin_shared_settings" filter on admin requests (#51161)
* Only load settings if it's admin * Add changelog
This commit is contained in:
parent
0ef7d95aff
commit
cb2549386a
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: performance
|
||||
|
||||
Only run woocommerce_admin_shared_settings filter on admin requests
|
|
@ -54,6 +54,11 @@ class WCAdminSharedSettings {
|
|||
* @return void
|
||||
*/
|
||||
public function on_woocommerce_blocks_loaded() {
|
||||
// Ensure we only add admin settings on the admin.
|
||||
if ( ! is_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( class_exists( '\Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry' ) ) {
|
||||
\Automattic\WooCommerce\Blocks\Package::container()->get( \Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )->add(
|
||||
$this->settings_prefix,
|
||||
|
@ -64,4 +69,3 @@ class WCAdminSharedSettings {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue