Role/Capability: Prevent a fatal error when checking a language capability early or in the frontend.
The meta capabilities `install_languages` and `update_languages` rely on the admin function `wp_can_install_language_pack()`. That function in turn relies on `request_filesystem_credentials()`, so it needs to be ensured that this function is available as well. Fixes #42230. Built from https://develop.svn.wordpress.org/trunk@41885 git-svn-id: http://core.svn.wordpress.org/trunk@41719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3f8621b632
commit
021afced82
|
@ -432,6 +432,10 @@ function map_meta_cap( $cap, $user_id ) {
|
|||
break;
|
||||
case 'install_languages':
|
||||
case 'update_languages':
|
||||
if ( ! function_exists( 'request_filesystem_credentials' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'wp_can_install_language_pack' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-beta2-41884';
|
||||
$wp_version = '4.9-beta2-41885';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue