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


PHP ReduxFramework::wp_content_url方法代码示例

本文整理汇总了PHP中ReduxFramework::wp_content_url方法的典型用法代码示例。如果您正苦于以下问题:PHP ReduxFramework::wp_content_url方法的具体用法?PHP ReduxFramework::wp_content_url怎么用?PHP ReduxFramework::wp_content_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReduxFramework的用法示例。


在下文中一共展示了ReduxFramework::wp_content_url方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
     }
 }
开发者ID:Ahmed-dawoud,项目名称:care4u,代码行数:34,代码来源:framework.php

示例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);
     }
 }
开发者ID:6226,项目名称:wp,代码行数:26,代码来源:framework.php

示例3: 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 = '/themeoptions/';
     self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
     self::$_url = get_template_directory_uri() . $relative_url;
 }
开发者ID:pradeep-web,项目名称:brandt,代码行数:10,代码来源:framework.php

示例4: 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;
     }
 }
开发者ID:ArgiaCyber,项目名称:alfath,代码行数:14,代码来源:framework.php

示例5: init

 public static function init()
 {
     $dir = Redux_Helpers::cleanFilePath(dirname(__FILE__));
     // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
     self::$_dir = trailingslashit($dir);
     self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
     // See if Redux is a plugin or not
     if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false || strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_template_directory_uri())) !== false || strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(WP_CONTENT_DIR . '/themes/')) !== false) {
         self::$_is_plugin = false;
     } else {
         // Check if plugin is a symbolic link, see if it's a plugin. If embedded, we can't do a thing.
         if (strpos(self::$_dir, ABSPATH) === false) {
             if (!function_exists('get_plugins')) {
                 require_once ABSPATH . 'wp-admin/includes/plugin.php';
             }
             $is_plugin = false;
             foreach (get_plugins() as $key => $value) {
                 if (is_plugin_active($key) && strpos($key, 'redux-framework.php') !== false) {
                     self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR . '/plugins/' . plugin_dir_path($key) . 'ReduxCore/'));
                     $is_plugin = true;
                 }
             }
             if (!$is_plugin) {
                 self::$_is_plugin = false;
             }
         }
     }
     if (self::$_is_plugin == true || self::$_as_plugin == true) {
         self::$_url = plugin_dir_url(__FILE__);
     } else {
         if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_template_directory())) !== false) {
             $relative_url = str_replace(Redux_Helpers::cleanFilePath(get_template_directory()), '', self::$_dir);
             self::$_url = trailingslashit(get_template_directory_uri() . $relative_url);
         } else {
             if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
                 $relative_url = str_replace(Redux_Helpers::cleanFilePath(get_stylesheet_directory()), '', self::$_dir);
                 self::$_url = trailingslashit(get_stylesheet_directory_uri() . $relative_url);
             } else {
                 $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::$_url = trailingslashit(self::$wp_content_url . $relative_url);
             }
         }
     }
     self::$_url = apply_filters("redux/_url", self::$_url);
     self::$_dir = apply_filters("redux/_dir", self::$_dir);
     self::$_is_plugin = apply_filters("redux/_is_plugin", self::$_is_plugin);
 }
开发者ID:aguerojahannes,项目名称:aguerojahannes.com,代码行数:49,代码来源:framework.php


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