本文整理汇总了PHP中ReduxFramework::_upload_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP ReduxFramework::_upload_dir方法的具体用法?PHP ReduxFramework::_upload_dir怎么用?PHP ReduxFramework::_upload_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReduxFramework
的用法示例。
在下文中一共展示了ReduxFramework::_upload_dir方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init()
{
global $wp_filesystem;
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = self::$wp_content_url . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
// Create our private upload directory
Redux_Functions::initWpFilesystem();
self::$_upload_dir = trailingslashit($wp_filesystem->wp_content_dir()) . '/redux/';
self::$_upload_url = trailingslashit(content_url()) . '/redux/';
if (function_exists('sys_get_temp_dir')) {
$tmp = sys_get_temp_dir();
if (empty($tmp)) {
$tmpDir = self::$_upload_url . 'tmp';
if (file_exists($tmpDir)) {
Redux_Helpers::rmdir($tmpDir);
}
putenv('TMPDIR=' . self::$_upload_dir . 'tmp');
}
}
// Ensure it exists
if (!is_dir(self::$_upload_dir)) {
// Create the directory
$wp_filesystem->mkdir(self::$_upload_dir);
}
}
示例2: init
static function init()
{
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = self::$wp_content_url . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
// Create our private upload directory
$upload = wp_upload_dir();
self::$_upload_dir = Redux_Helpers::cleanFilePath($upload['basedir']) . '/redux/';
self::$_upload_url = Redux_Helpers::cleanFilePath($upload['baseurl']) . '/redux/';
// Ensure it exists
if (!is_dir(self::$_upload_dir)) {
global $wp_filesystem;
// Init wp_filesystem
Redux_Functions::initWpFilesystem();
// Create the directory
$wp_filesystem->mkdir(self::$_upload_dir);
}
}
示例3: set_redux_content
private function set_redux_content()
{
$upload_dir = wp_upload_dir();
self::$_upload_dir = $upload_dir['basedir'] . '/redux/';
self::$_upload_url = $upload_dir['baseurl'] . '/redux/';
if (!is_dir(self::$_upload_dir)) {
$this->filesystem->execute('mkdir', self::$_upload_dir);
}
}
示例4: set_redux_content
private function set_redux_content()
{
$upload_dir = wp_upload_dir();
self::$_upload_dir = $upload_dir['basedir'] . '/redux/';
self::$_upload_url = $upload_dir['baseurl'] . '/redux/';
}
示例5: set_redux_content
private function set_redux_content()
{
$upload_dir = wp_upload_dir();
self::$_upload_dir = $upload_dir['basedir'] . '/redux/';
self::$_upload_url = str_replace(array('https://', 'http://'), '//', $upload_dir['baseurl'] . '/redux/');
}
示例6: set_redux_content
private function set_redux_content()
{
$upload_dir = wp_upload_dir();
self::$_upload_dir = $upload_dir['basedir'] . '/redux/';
self::$_upload_url = $upload_dir['baseurl'] . '/redux/';
if (!is_dir(self::$_upload_dir) && $this->args['save_defaults'] === true) {
$this->filesystem->execute('mkdir', self::$_upload_dir);
}
}
示例7: set_redux_content
private function set_redux_content()
{
$wp_content_dir = Redux_Helpers::cleanFilePath(trailingslashit(WP_CONTENT_DIR));
self::$_upload_dir = $wp_content_dir . '/uploads/redux/';
self::$_upload_url = Redux_Helpers::cleanFilePath(trailingslashit(content_url())) . '/uploads/redux/';
if (!is_dir(self::$_upload_dir)) {
$this->filesystem->execute('mkdir', self::$_upload_dir);
}
}