plugin_locale
Filters a plugin's locale.
Description
Note: the first-loaded translation file overrides any following ones if the same translation is present
Parameters (2)
- 0. $get_locale (unknown) =>
get_locale()
- The get locale.
- 1. $woocommerce_myparcel (string) =>
'woocommerce-myparcel'
- The woocommerce myparcel.
Usage
- To run the hook, copy the example below.
- $get_locale = apply_filters( 'plugin_locale', $get_locale, $woocommerce_myparcel );
- if ( !empty( $get_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( $get_locale, $woocommerce_myparcel ) {
- // make filter magic happen here...
- return $get_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-myparcel.php
- $locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce-myparcel' );