ClassicPress logo
Skip to content
Filter by type:

Browse:

  • Home
  • Functions
  • signup_get_available_languages()

signup_get_available_languages()

Retrieves languages available during the site/user sign-up process.


Description

See also

  • get_available_languages()


Return

(string[]) Array of available language codes. Language codes are formed by stripping the .mo extension from the language file names.


Source

File: wp-signup.php

function signup_get_available_languages() {
	/**
	 * Filters the list of available languages for front-end site signups.
	 *
	 * Passing an empty array to this hook will disable output of the setting on the
	 * signup form, and the default language will be used when creating the site.
	 *
	 * Languages not already installed will be stripped.
	 *
	 * @since WP-4.4.0
	 *
	 * @param array $available_languages Available languages.
	 */
	$languages = (array) apply_filters( 'signup_get_available_languages', get_available_languages() );

	/*
	 * Strip any non-installed languages and return.
	 *
	 * Re-call get_available_languages() here in case a language pack was installed
	 * in a callback hooked to the 'signup_get_available_languages' filter before this point.
	 */
	return array_intersect_assoc( $languages, get_available_languages() );
}

Expand Source Code View on GitHub


Related

Uses

Uses
Uses Description
wp-signup.php: signup_get_available_languages

Filters the list of available languages for front-end site sign-ups.

wp-includes/plugin.php: apply_filters()

Calls the callback functions that have been added to a filter hook.

Used By

Used By
Used By Description
wp-signup.php: validate_blog_signup()

Validates new site signup.

wp-signup.php: show_blog_form()

Generates and displays the Sign-up and Create Site forms.

wp-signup.php: validate_another_blog_signup()

Validates a new site sign-up for an existing user.


Changelog

Changelog
Version Description
4.4.0 Introduced.
ClassicPress Documentation • Made with ClassicPress
Privacy Policy