wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_maybe_grant_install_languages_cap › WordPress Function

Seit4.9.0
Veraltetn/v
wp_maybe_grant_install_languages_cap ( $allcaps )
Parameter:
  • (bool[]) $allcaps An array of all the user's capabilities.
    Erforderlich: Ja
Gibt zurück:
  • (bool[]) Filtered array of the user's capabilities.
Definiert in:
Codex:

Filters the user capabilities to grant the 'install_languages' capability as necessary.

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


Quellcode

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;
}