当前位置: 首页>>代码示例>>PHP>>正文


PHP Language_Pack_Upgrader::fs_connect方法代码示例

本文整理汇总了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;
}
开发者ID:johnpbloch,项目名称:wordpress,代码行数:23,代码来源:translation-install.php

示例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;
}
开发者ID:inpsyde,项目名称:wordpress-dev,代码行数:22,代码来源:translation-install.php


注:本文中的Language_Pack_Upgrader::fs_connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。