本文整理汇总了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);
}
}
}
}
示例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');
}
}
示例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");
}
示例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();
}
示例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);
}
示例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());
}
}
示例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());
}
}
}
示例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);
}
示例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);
}
}
示例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');
}
}
示例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';
}
}
示例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';
}
}
示例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();
}
示例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']}/");
}
示例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
// );
}