lang_codes

Filters the language codes.

Description

apply_filters( 'lang_codes', (array) $lang_codes, (string) $code ); 

Parameters (2)

0. $lang_codes (array)
Key/value pair of language codes where key is the short version.
1. $code (string)
A two-letter designation of the language.

Usage

To run the hook, copy the example below.
  1. $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code ); 
  2.  
  3. if ( !empty( $lang_codes ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the lang_codes callback 
  2. function filter_lang_codes( $lang_codes, $code ) { 
  3. // make filter magic happen here... 
  4. return $lang_codes
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'lang_codes', 'filter_lang_codes', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'lang_codes', 'filter_lang_codes', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/ms.php  
  1. $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code );