woocommerce_shared_settings
Filters the array of shared settings.
Low level hook for registration of new data late in the cycle. This is deprecated. Instead, use the data api:
Automattic\WooCommerce\Blocks\Package::container()->get( Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )->add( $key, $value )
Usage
add_filter( 'woocommerce_shared_settings', 'wp_kama_woocommerce_shared_settings_filter' );
/**
* Function for `woocommerce_shared_settings` filter-hook.
*
* @param array $data Settings data.
*
* @return array
*/
function wp_kama_woocommerce_shared_settings_filter( $data ){
// filter...
return $data;
}
- $data(array)
- Settings data.
Changelog
| Since 5.0.0 | Introduced. |
Where the hook is called
woocommerce_shared_settings
woocommerce/src/Blocks/Assets/AssetDataRegistry.php 242
$settings = apply_filters( 'woocommerce_shared_settings', $this->data );