本文整理汇总了PHP中Plugin_Upgrader::fs_connect方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin_Upgrader::fs_connect方法的具体用法?PHP Plugin_Upgrader::fs_connect怎么用?PHP Plugin_Upgrader::fs_connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin_Upgrader
的用法示例。
在下文中一共展示了Plugin_Upgrader::fs_connect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_uploading_allowed
public function is_uploading_allowed()
{
if (!isset($this->uploading_allowed)) {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
require_once WP_Installer()->plugin_path() . '/includes/installer-upgrader-skins.php';
$upgrader_skins = new Installer_Upgrader_Skins();
//use our custom (mute) Skin
$upgrader = new Plugin_Upgrader($upgrader_skins);
ob_start();
$res = $upgrader->fs_connect(array(WP_CONTENT_DIR, WP_PLUGIN_DIR));
ob_end_clean();
if (!$res || is_wp_error($res)) {
$this->uploading_allowed = false;
} else {
$this->uploading_allowed = true;
}
}
return $this->uploading_allowed;
}