wp_maybe_grant_resume_extensions_caps

The timeline below displays how wordpress function wp_maybe_grant_resume_extensions_caps has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.2

/**
 * Filters the user capabilities to grant the 'resume_plugins' and 'resume_themes' capabilities as necessary.
 *
 * @since 5.2.0
 *
 * @param bool[] $allcaps An array of all the user's capabilities.
 * @return bool[] Filtered array of the user's capabilities.
 */
function wp_maybe_grant_resume_extensions_caps($allcaps)
{
    // Even in a multisite, regular administrators should be able to resume plugins.
    if (!empty($allcaps['activate_plugins'])) {
        $allcaps['resume_plugins'] = true;
    }
    // Even in a multisite, regular administrators should be able to resume themes.
    if (!empty($allcaps['switch_themes'])) {
        $allcaps['resume_themes'] = true;
    }
    return $allcaps;
}