plugin_locale
Filters a plugin's locale.
Description
Parameters (2)
- 0. $locale (unknown)
- The locale.
- 1. $woocommerce (string) =>
'woocommerce'
- The
woocommerce
.
Usage
- To run the hook, copy the example below.
- $locale = apply_filters( 'plugin_locale', $locale, $woocommerce );
- if ( !empty( $locale ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the plugin_locale callback
- function filter_plugin_locale( $locale, $woocommerce ) {
- // make filter magic happen here...
- return $locale;
- };
- // add the filter
- add_filter( 'plugin_locale', 'filter_plugin_locale', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'plugin_locale', 'filter_plugin_locale', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /woocommerce.php
- $locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' );