Skip to content
  • Log In
  • Register
WordPress.org
  • News
  • Download & Extend
    • Get WordPress
    • Themes
    • Patterns
    • Plugins
    • Openverse
    • Mobile
    • Hosting
  • Learn
    • Learn WordPress
    • Documentation
    • Forums
    • WordPress.tv
    • Developers
  • Community
    • Make WordPress
    • WordCamp
    • Meetups
    • Photo Directory
    • Job Board
    • Five for the Future
  • About
    • About WordPress
    • Showcase
    • Gutenberg
    • Enterprise
    • WordPress Swag Store
  • Get WordPress
Get WordPress

Developer Resources

Browse: Home / Reference / Functions / signup_get_available_languages()

signup_get_available_languages(): string[]

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

Contents

  • Description
    • See also
  • Return
  • Source
  • Hooks
  • Related
    • Uses
    • Used By
  • Changelog
  • User Contributed Notes

Description

Top ↑

See also

  • get_available_languages()

Top ↑

Return

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


Top ↑

Source

File: wp-signup.php. View all references

function signup_get_available_languages() {
	/**
	 * 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.
	 */
	$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() );
}

View on Trac View on GitHub


Top ↑

Hooks

apply_filters( 'signup_get_available_languages', string[] $languages )

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


Top ↑

Related

Top ↑

Uses

Uses
Uses Description
get_available_languages() wp-includes/l10n.php

Gets all available languages based on the presence of *.mo files in a given directory.

apply_filters() wp-includes/plugin.php

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

Top ↑

Used By

Used By
Used By Description
validate_another_blog_signup() wp-signup.php

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

validate_blog_signup() wp-signup.php

Validates new site signup.

show_blog_form() wp-signup.php

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


Top ↑

Changelog

Changelog
Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.

  • About
  • News
  • Hosting
  • Donate
  • Swag
  • Documentation
  • Developers
  • Get Involved
  • Learn
  • Showcase
  • Plugins
  • Themes
  • Patterns
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • Privacy
  • Public Code
WordPress.org
WordPress.org
  • Visit our Facebook page
  • Visit our Twitter account
  • Visit our Instagram account
  • Visit our LinkedIn account
Code is Poetry

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.