signup_get_available_languages

Retrieves languages available during the site/user signup process.

Description

(array) signup_get_available_languages(); 

Returns (array)

List of available languages.


Usage

  1. if ( !function_exists( 'signup_get_available_languages' ) ) { 
  2. require_once '/wp-signup.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = signup_get_available_languages(); 
  7.  

Defined (1)

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

/wp-signup.php  
  1. function signup_get_available_languages() { 
  2. /** 
  3. * Filters the list of available languages for front-end site signups. 
  4. * Passing an empty array to this hook will disable output of the setting on the 
  5. * signup form, and the default language will be used when creating the site. 
  6. * Languages not already installed will be stripped. 
  7. * @since 4.4.0 
  8. * @param array $available_languages Available languages. 
  9. */ 
  10.  
  11. /** 
  12. * Strip any non-installed languages and return. 
  13. * Re-call get_available_languages() here in case a language pack was installed 
  14. * in a callback hooked to the 'signup_get_available_languages' filter before this point. 
  15. */ 
  16. return array_intersect_assoc( $languages, get_available_languages() );