Title: wp_maybe_grant_install_languages_cap
Published: November 20, 2017
Last modified: May 20, 2026

---

# wp_maybe_grant_install_languages_cap( bool[] $allcaps ): bool[]

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#wp--skip-link--target)

Filters the user capabilities to grant the ‘install_languages’ capability as necessary.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#description)󠁿

A user must have at least one out of the ‘update_core’, ‘install_plugins’, and ‘
install_themes’ capabilities to qualify for ‘install_languages’.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#parameters)󠁿

 `$allcaps`bool[]required

An array of all the user’s capabilities.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#return)󠁿

 bool[] Filtered array of the user’s capabilities.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#source)󠁿

    ```php
    function wp_maybe_grant_install_languages_cap( $allcaps ) {
    	if ( ! empty( $allcaps['update_core'] ) || ! empty( $allcaps['install_plugins'] ) || ! empty( $allcaps['install_themes'] ) ) {
    		$allcaps['install_languages'] = true;
    	}

    	return $allcaps;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/capabilities.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/capabilities.php#L1313)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/capabilities.php#L1313-L1319)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_maybe_grant_install_languages_cap/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_maybe_grant_install_languages_cap%2F)
before being able to contribute a note or feedback.