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


PHP Redux_Functions类代码示例

本文整理汇总了PHP中Redux_Functions的典型用法代码示例。如果您正苦于以下问题:PHP Redux_Functions类的具体用法?PHP Redux_Functions怎么用?PHP Redux_Functions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Redux_Functions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: compile_sass

 public static function compile_sass($parent)
 {
     if (!empty(self::$path)) {
         require "scssphp/scss.inc.php";
         $scss = new scssc();
         $scss->setImportPaths(self::$path);
         if (!$parent->args['dev_mode']) {
             $scss->setFormatter("scss_formatter_compressed");
         }
         $new_css = '';
         foreach (self::$import as $import) {
             $new_css .= $scss->compile($import);
         }
         if ($new_css != '') {
             if ($parent->args['sass']['page_output']) {
                 echo '<style type="text/css" id="redux-' . $parent->args['opt_name'] . '">' . $new_css . '</style>';
             } else {
                 Redux_Functions::initWpFilesystem();
                 global $wp_filesystem;
                 $css_file = Redux_Helpers::cleanFilePath($parent->args['sass']['output_url'] . $parent->args['opt_name'] . '-redux.css');
                 $ret_val = $wp_filesystem->put_contents($css_file, $new_css, FS_CHMOD_FILE);
             }
         }
     }
 }
开发者ID:masterdoed,项目名称:wpmovielibrary,代码行数:25,代码来源:class.redux_sass.php

示例2: enqueue

 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since ReduxFramework 0.0.4
  */
 function enqueue()
 {
     wp_enqueue_script('redux-field-switch-js', ReduxFramework::$_url . 'inc/fields/switch/field_switch' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('redux-field-switch-css', ReduxFramework::$_url . 'inc/fields/switch/field_switch.css', array(), time(), 'all');
     }
 }
开发者ID:siiiiilvio,项目名称:kadcnc,代码行数:13,代码来源:field_switch.php

示例3: init

 public function init()
 {
     $this->min = Redux_Functions::isMin();
     $this->timestamp = ReduxFramework::$_version;
     if ($this->parent->args['dev_mode']) {
         $this->timestamp .= '.' . time();
     }
     $this->register_styles();
     $this->register_scripts();
     add_thickbox();
     $this->enqueue_fields();
     $this->set_localized_data();
     /**
      * action 'redux-enqueue-{opt_name}'
      *
      * @deprecated
      *
      * @param  object $this ReduxFramework
      */
     do_action("redux-enqueue-{$this->parent->args['opt_name']}", $this->parent);
     // REMOVE
     /**
      * action 'redux/page/{opt_name}/enqueue'
      */
     do_action("redux/page/{$this->parent->args['opt_name']}/enqueue");
 }
开发者ID:lenguyenitc,项目名称:donations,代码行数:26,代码来源:enqueue.php

示例4: __construct

 /**
  * Field Constructor.
  *
  * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
  *
  * @since ReduxFramework 1.0.0
  */
 function __construct($field = array(), $value = '', $parent)
 {
     global $wp_filesystem;
     $this->parent = $parent;
     $this->field = $field;
     $this->value = $value;
     // Init wp_filesystem
     Redux_Functions::initWpFilesystem();
     // Set upload dir path for google fonts
     $this->font_dir = ReduxFramework::$_upload_dir . 'google-fonts/';
     // Check for redux_google_font dir
     if (!is_dir($this->font_dir)) {
         // Create it, if not found
         $wp_filesystem->mkdir($this->font_dir, FS_CHMOD_DIR);
     }
     // Set google font file variables
     $this->google_html = $this->font_dir . 'googlefonts.html';
     $this->google_json = $this->font_dir . 'googlefonts.json';
     // Move installed googlefonts.html to upload location, if not exists
     if (!file_exists($this->google_html)) {
         $wp_filesystem->copy(ReduxFramework::$_dir . 'inc/fields/typography/googlefonts.html', $this->font_dir . 'googlefonts.html', false);
     }
     // Move installed googlefonts.json to upload location, if not exists
     if (!file_exists($this->google_json)) {
         $wp_filesystem->copy(ReduxFramework::$_dir . 'inc/fields/typography/googlefonts.json', $this->font_dir . 'googlefonts.json', false);
     }
     // Get the google array
     $this->getGoogleArray();
 }
开发者ID:EmreKarahan,项目名称:wordpress,代码行数:36,代码来源:field_typography.php

示例5: enqueue

 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since         1.0.0
  * @access        public
  * @return        void
  */
 public function enqueue()
 {
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('redux-field-date-css', ReduxFramework::$_url . 'inc/fields/date/field_date.css', array(), time(), 'all');
     }
     wp_enqueue_script('redux-field-date-js', ReduxFramework::$_url . 'inc/fields/date/field_date' . Redux_Functions::isMin() . '.js', array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'redux-js'), time(), true);
 }
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:15,代码来源:field_date.php

示例6: get_notice_json

 private function get_notice_json()
 {
     // filesystem object
     $filesystem = $this->parent->filesystem;
     // get notice data from server
     //$data = $filesystem->execute('get_contents', $this->server_file);// 'http://www.reduxframework.com/' . 'wp-content/uploads/redux/redux_notice.json');
     $data = wp_remote_get($this->server_file, array('sslverify' => false));
     $data = $data['body'];
     // if some data exists
     if ($data != '' || !empty($data)) {
         // if local notice file exists
         if (file_exists($this->notice_json)) {
             // get cached data
             $cache_data = $filesystem->execute('get_contents', $this->notice_json);
             // if local and server data are same, then return
             if (strcmp($data, $cache_data) == 0) {
                 // set new cookie for interval value
                 Redux_Functions::setCookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
                 // bail out
                 return;
             }
         }
         // set server data
         $params = array('content' => $data);
         // write local notice file with new data
         $filesystem->execute('put_contents', $this->notice_json, $params);
         // set cookie for three day expiry
         setcookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
         // set unique key for dismiss meta key
         update_option($this->cookie_id, time());
     }
 }
开发者ID:liyanouou,项目名称:wordpress,代码行数:32,代码来源:newsflash.php

示例7: get_notice_json

 private function get_notice_json()
 {
     // get notice data from server
     $data = @wp_remote_get($this->server_file, array('sslverify' => false));
     if (isset($data) && !empty($data) && !is_wp_error($data) && $data['response']['code'] == 200) {
         $data = $data['body'];
         // if some data exists
         if ($data != '' || !empty($data)) {
             if (!empty($this->notice_data)) {
                 if (strcmp($data, $this->notice_data) == 0) {
                     // set new cookie for interval value
                     Redux_Functions::setCookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
                     // bail out
                     return;
                 }
             }
             update_option('r_notice_data', $data);
             $this->notice_data = $data;
             // set cookie for three day expiry
             setcookie($this->cookie_id, time(), time() + 86400 * $this->interval, '/');
             // set unique key for dismiss meta key
             update_option($this->cookie_id, time());
         }
     }
 }
开发者ID:jzornow,项目名称:cotton_consulting,代码行数:25,代码来源:newsflash.php

示例8: enqueue

 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('redux-field-editor-css', ReduxFramework::$_url . 'inc/fields/editor/field_editor.css', array(), time(), 'all');
     }
     wp_enqueue_script('redux-field-editor-js', ReduxFramework::$_url . 'inc/fields/editor/field_editor' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true);
 }
开发者ID:junrillg,项目名称:platystarter,代码行数:15,代码来源:field_editor.php

示例9: enqueue

 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     wp_enqueue_script('redux-field-multi-text-js', ReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('redux-field-multi-text-css', ReduxFramework::$_url . 'inc/fields/multi_text/field_multi_text.css', array(), time(), true);
     }
 }
开发者ID:LuisEnVilla,项目名称:viajes400,代码行数:15,代码来源:field_multi_text.php

示例10: enqueue

 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function enqueue()
 {
     $min = Redux_Functions::isMin();
     wp_enqueue_script('redux-field-palette-js', ReduxFramework::$_url . 'inc/fields/palette/field_palette' . $min . '.js', array('jquery', 'redux-js', 'jquery-ui-button', 'jquery-ui-core'), time(), true);
     if ($this->parent->args['dev_mode']) {
         wp_enqueue_style('redux-field-palette-css', ReduxFramework::$_url . 'inc/fields/palette/field_palette.css', array(), time(), 'all');
     }
 }
开发者ID:seokafasi,项目名称:redux-framework,代码行数:16,代码来源:field_palette.php

示例11: get_url

 public static function get_url($handle)
 {
     if ($handle == 'select2-js' && file_exists(self::$dir . 'vendor/select2/select2' . Redux_Functions::isMin() . '.js')) {
         return self::$url . 'vendor/select2/select2.js';
     } elseif ($handle == 'select2-css' && file_exists(self::$dir . 'vendor/select2/select2.css')) {
         return self::$url . 'vendor/select2/select2.css';
     }
 }
开发者ID:neruub,项目名称:shop_sda,代码行数:8,代码来源:class.vendor-url.php

示例12: get_url

 public static function get_url($handle)
 {
     if ($handle == 'select2-js' && file_exists(self::$dir . 'vendor/select2/select2' . Redux_Functions::isMin() . '.js')) {
         return get_template_directory_uri() . '/themeoptions/options/extensions/vendor_support/vendor/select2/select2.js';
     } elseif ($handle == 'select2-css' && file_exists(self::$dir . 'vendor/select2/select2.css')) {
         return get_template_directory_uri() . '/themeoptions/options_assets/extensions/vendor_support/vendor/select2/select2.css';
     }
 }
开发者ID:pcuervo,项目名称:od4d,代码行数:8,代码来源:class.vendor-url.php

示例13: __construct

 public function __construct($parent)
 {
     $this->parent = $parent;
     Redux_Functions::$_parent = $parent;
     $this->template_path = $this->original_path = ReduxFramework::$_dir . 'templates/panel/';
     $this->template_path = trailingslashit(apply_filters("redux/{$this->parent->args['opt_name']}/panel/templates_path", $this->template_path));
     $this->panel_template();
 }
开发者ID:mertyildiran,项目名称:grandinsaat,代码行数:8,代码来源:panel.php

示例14: __construct

 public function __construct($parent)
 {
     $this->parent = $parent;
     Redux_Functions::$_parent = $parent;
     /**
      * action 'redux/page/{opt_name}/'
      */
     do_action("redux/page/{$parent->args['opt_name']}/");
 }
开发者ID:berniecultess,项目名称:infirev,代码行数:9,代码来源:required.php

示例15: enqueue

 /**
  * Enqueue Function.
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since ReduxFramework 0.0.4
  */
 function enqueue()
 {
     wp_enqueue_script('redux-field-switch-js', ReduxFramework::$_url . 'inc/fields/switch/field_switch' . Redux_Functions::isMin() . '.js', array('jquery', 'redux-js'), time(), true);
     redux_enqueue_style($this->parent, 'redux-field-switch-css', ReduxFramework::$_url . 'inc/fields/switch/field_switch.css', ReduxFramework::$_dir . 'inc/fields/switch', array(), time(), false);
     //                wp_enqueue_style(
     //                    'redux-field-switch-css',
     //                    ReduxFramework::$_url . 'inc/fields/switch/field_switch.css',
     //                    time(),
     //                    true
     //                );
 }
开发者ID:venturepact,项目名称:blog,代码行数:17,代码来源:field_switch.php


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