wp_maybe_grant_install_languages_cap( bool[] $allcaps )

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


Description Description

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


Top ↑

Parameters Parameters

$allcaps

(bool[]) (Required) An array of all the user's capabilities.


Top ↑

Return Return

(bool[]) Filtered array of the user's capabilities.


Top ↑

Source Source

File: wp-includes/capabilities.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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
4.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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