Filter hook 'signup_get_available_languages'

in WP Core File wp-signup.php at line 918

View Source

signup_get_available_languages

Filter Hook
Description
Filters the list of available languages for front-end site sign-ups. Passing an empty array to this hook will disable output of the setting on the sign-up form, and the default language will be used when creating the site. Languages not already installed will be stripped.

Hook Information

File Location wp-signup.php View on GitHub
Hook Type Filter
Line Number 918

Hook Parameters

Type Name Description
string[] $languages Array of available language codes. Language codes are formed by stripping the .mo extension from the language file names.

Usage Examples

Basic Usage
<?php
// Hook into signup_get_available_languages
add_filter('signup_get_available_languages', 'my_custom_filter', 10, 1);

function my_custom_filter($languages) {
    // Your custom filtering logic here
    return $languages;
}

Source Code Context

wp-signup.php:918 - How this hook is used in WordPress core
<?php
 913  	 * @since 4.4.0
 914  	 *
 915  	 * @param string[] $languages Array of available language codes. Language codes are formed by
 916  	 *                            stripping the .mo extension from the language file names.
 917  	 */
 918  	$languages = (array) apply_filters( 'signup_get_available_languages', get_available_languages() );
 919  
 920  	/*
 921  	 * Strip any non-installed languages and return.
 922  	 *
 923  	 * Re-call get_available_languages() here in case a language pack was installed

PHP Documentation

<?php
/**
	 * Filters the list of available languages for front-end site sign-ups.
	 *
	 * Passing an empty array to this hook will disable output of the setting on the
	 * sign-up form, and the default language will be used when creating the site.
	 *
	 * Languages not already installed will be stripped.
	 *
	 * @since 4.4.0
	 *
	 * @param string[] $languages Array of available language codes. Language codes are formed by
	 *                            stripping the .mo extension from the language file names.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-signup.php
Related Hooks

Related hooks will be displayed here in future updates.