wpml_active_languages

The WooCommerce Multilingual wpml active languages hook.

Description

apply_filters( 'wpml_active_languages', (callback) $array, (callback) $array ); 

Parameters (2)

0. $array (array) => array()
The array.
1. $array — Optional. (callback) => array( 'skip_missing' => 0, 'orderby' => 'code' )
The array.

Usage

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

Defined (1)

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

/inc/class-wcml-orders.php  
  1. $languages = apply_filters( 'wpml_active_languages', array(), array( 'skip_missing' => 0, 'orderby' => 'code' ) );