本文整理汇总了PHP中Language_Pack_Upgrader::fs_connect方法的典型用法代码示例。如果您正苦于以下问题:PHP Language_Pack_Upgrader::fs_connect方法的具体用法?PHP Language_Pack_Upgrader::fs_connect怎么用?PHP Language_Pack_Upgrader::fs_connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language_Pack_Upgrader
的用法示例。
在下文中一共展示了Language_Pack_Upgrader::fs_connect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_can_install_language_pack
/**
* Check if WordPress has access to the filesystem without asking for
* credentials.
*
* @since 4.0.0
*
* @return bool Returns true on success, false on failure.
*/
function wp_can_install_language_pack()
{
if (defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS) {
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;
}
示例2: wp_can_install_language_pack
/**
* Check if WordPress has access to the filesystem without asking for
* credentials.
*
* @since 4.0.0
*
* @return bool Returns true on success, false on failure.
*/
function wp_can_install_language_pack()
{
if (defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS) {
return false;
}
$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;
}