Uses
Uses | Description |
---|---|
wp-includes/load.php: wp_is_file_mod_allowed() | Determines whether file modifications are allowed. |
wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Check if WordPress has access to the filesystem without asking for credentials.
(bool) Returns true on success, false on failure.
File: wp-admin/includes/translation-install.php
function wp_can_install_language_pack() { if ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) { return false; } require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $skin = new Automatic_Upgrader_Skin; $upgrader = new Language_Pack_Upgrader( $skin ); $upgrader->init(); $check = $upgrader->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) ); if ( ! $check || is_wp_error( $check ) ) { return false; } return true; }
Version | Description |
---|---|
4.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_can_install_language_pack