本文整理汇总了PHP中Redux_Helpers::isFieldInUse方法的典型用法代码示例。如果您正苦于以下问题:PHP Redux_Helpers::isFieldInUse方法的具体用法?PHP Redux_Helpers::isFieldInUse怎么用?PHP Redux_Helpers::isFieldInUse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redux_Helpers
的用法示例。
在下文中一共展示了Redux_Helpers::isFieldInUse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class Constructor. Defines the args for the extions class
*
* @since 1.0.0
* @access public
*
* @param array $sections Panel sections.
* @param array $args Class constructor arguments.
* @param array $extra_tabs Extra panel tabs.
*
* @return void
*/
public function __construct($parent)
{
$this->parent = $parent;
if (empty($this->extension_dir)) {
//$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
}
$this->field_name = 'options_object';
self::$theInstance = $this;
$this->is_field = Redux_Helpers::isFieldInUse($parent, 'options_object');
if (!$this->is_field && $this->parent->args['dev_mode'] && $this->parent->args['show_options_object']) {
$this->add_section();
}
add_filter('redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path'));
// Adds the local field
}
开发者ID:guardiantheme,项目名称:Elevator-Free-Business-WordPress-Theme,代码行数:27,代码来源:extension_options_object.php
示例2: __construct
/**
* Class Constructor. Defines the args for the extions class
*
* @since 1.0.0
* @access public
*
* @param array $sections Panel sections.
* @param array $args Class constructor arguments.
* @param array $extra_tabs Extra panel tabs.
*
* @return void
*/
public function __construct($parent)
{
$this->parent = $parent;
if (empty($this->extension_dir)) {
//$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
}
$this->field_name = 'import_export';
self::$theInstance = $this;
add_action("wp_ajax_redux_link_options-" . $this->parent->args['opt_name'], array($this, "link_options"));
add_action("wp_ajax_nopriv_redux_link_options-" . $this->parent->args['opt_name'], array($this, "link_options"));
add_action("wp_ajax_redux_download_options-" . $this->parent->args['opt_name'], array($this, "download_options"));
add_action("wp_ajax_nopriv_redux_download_options-" . $this->parent->args['opt_name'], array($this, "download_options"));
do_action("redux/options/{$this->parent->args['opt_name']}/import", array($this, 'remove_cookie'));
$this->is_field = Redux_Helpers::isFieldInUse($parent, 'import_export');
if (!$this->is_field && $this->parent->args['show_import_export']) {
$this->add_section();
}
add_filter('redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path'));
// Adds the local field
add_filter('upload_mimes', array($this, 'custom_upload_mimes'));
}
示例3: in_field
public function in_field()
{
$this->is_field = Redux_Helpers::isFieldInUse($this->parent, 'import_export');
}
示例4: _enqueue
/**
* Enqueue CSS/JS for options page
*
* @since 1.0.0
* @access public
* @global $wp_styles
* @return void
*/
public function _enqueue()
{
global $wp_styles;
wp_register_style('redux-css', self::$_url . 'assets/css/redux.css', array('farbtastic'), filemtime(self::$_dir . 'assets/css/redux.css'), 'all');
wp_register_style('redux-elusive-icon', self::$_url . 'assets/css/vendor/elusive-icons/elusive-webfont.css', array(), filemtime(self::$_dir . 'assets/css/vendor/elusive-icons/elusive-webfont.css'), 'all');
wp_register_style('redux-elusive-icon-ie7', self::$_url . 'assets/css/vendor/elusive-icons/elusive-webfont-ie7.css', array(), filemtime(self::$_dir . 'assets/css/vendor/elusive-icons/elusive-webfont-ie7.css'), 'all');
wp_register_style('select2-css', self::$_url . 'assets/js/vendor/select2/select2.css', array(), filemtime(self::$_dir . 'assets/js/vendor/select2/select2.css'), 'all');
wp_register_style('qtip-css', self::$_url . 'assets/css/vendor/qtip/jquery.qtip.css', array(), filemtime(self::$_dir . 'assets/css/vendor/qtip/jquery.qtip.css'), 'all');
wp_register_style('nouislider-css', self::$_url . 'assets/css/vendor/nouislider/jquery.nouislider.css', array(), filemtime(self::$_dir . 'assets/css/vendor/nouislider/jquery.nouislider.css'), 'all');
$wp_styles->add_data('redux-elusive-icon-ie7', 'conditional', 'lte IE 7');
/**
* jQuery UI stylesheet src
* filter 'redux/page/{opt_name}/enqueue/jquery-ui-css'
* @param string bundled stylesheet src
*/
wp_register_style('jquery-ui-css', apply_filters("redux/page/{$this->args['opt_name']}/enqueue/jquery-ui-css", self::$_url . 'assets/css/vendor/jquery-ui-bootstrap/jquery-ui-1.10.0.custom.css'), '', filemtime(self::$_dir . 'assets/css/vendor/jquery-ui-bootstrap/jquery-ui-1.10.0.custom.css'), 'all');
wp_enqueue_style('jquery-ui-css');
wp_enqueue_style('redux-lte-ie8');
wp_enqueue_style('redux-css');
wp_enqueue_style('select2-css');
wp_enqueue_style('nouislider-css');
wp_enqueue_style('qtip-css');
wp_enqueue_style('redux-elusive-icon');
wp_enqueue_style('redux-elusive-icon-ie7');
if (is_rtl()) {
wp_register_style('redux-rtl-css', self::$_url . 'assets/css/rtl.css', '', filemtime(self::$_dir . 'assets/css/rtl.css'), 'all');
wp_enqueue_style('redux-rtl-css');
}
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_style('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_script('jquery-ui-dialog');
wp_enqueue_script('jquery-ui-slider');
wp_enqueue_script('wp-color-picker');
wp_enqueue_script('jquery-ui-accordion');
wp_enqueue_style('wp-color-picker');
if (function_exists('wp_enqueue_media')) {
wp_enqueue_media();
} else {
wp_enqueue_script('media-upload');
}
add_thickbox();
wp_register_script('select2-js', self::$_url . 'assets/js/vendor/select2/select2.min.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor/select2/select2.min.js'), true);
wp_register_script('qtip-js', self::$_url . 'assets/js/vendor/qtip/jquery.qtip.js', array('jquery'), '2.2.0', true);
wp_register_script('nouislider-js', self::$_url . 'assets/js/vendor/nouislider/jquery.nouislider.min.js', array('jquery'), '5.0.0', true);
wp_register_script('serializeForm-js', self::$_url . 'assets/js/vendor/jquery.serializeForm.js', array('jquery'), '1.0.0', true);
// Register ACE if it's being used
$ace_prereq = null;
if (Redux_Helpers::isFieldInUse($this, 'ace_editor')) {
$ace_prereq = 'ace-editor-js';
wp_enqueue_script($ace_prereq, self::$_url . 'assets/js/vendor/ace_editor/ace.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor/ace_editor/ace.js'), true);
}
// default JS dependency aarray
$arrEnq = array('jquery', 'select2-js', 'qtip-js', 'nouislider-js', 'serializeForm-js');
// Embed the compress version unless in dev mode
// dev_mode = true
if (isset($this->args['dev_mode']) && $this->args['dev_mode'] === true) {
wp_register_script('redux-vendor', self::$_url . 'assets/js/vendor.min.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor.min.js'), true);
// push redux-cendor into dep array
$arrDev = $arrEnq;
array_push($arrDev, 'redux-vendor');
// If ACE is loaded, push in into the dep array
if ('' != $ace_prereq) {
array_push($arrDev, $ace_prereq);
}
wp_register_script('redux-js', self::$_url . 'assets/js/redux.js', $arrDev, filemtime(self::$_dir . 'assets/js/redux.js'), true);
// dev_mode - false
} else {
// If ACE loaded, push into the dep array
$arrProd = $arrEnq;
if ('' != $ace_prereq) {
array_push($arrProd, $ace_prereq);
}
if (file_exists(self::$_dir . 'assets/js/redux.min.js')) {
wp_register_script('redux-js', self::$_url . 'assets/js/redux.min.js', $arrProd, filemtime(self::$_dir . 'assets/js/redux.min.js'), true);
}
}
foreach ($this->sections as $section) {
if (isset($section['fields'])) {
foreach ($section['fields'] as $field) {
// TODO AFTER GROUP WORKS - Revert IF below
// if( isset( $field['type'] ) && $field['type'] != 'callback' ) {
if (isset($field['type']) && $field['type'] != 'callback' && $field['type'] != 'group') {
//if ('typography' == $field['type']) {
//continue;
//}
$field_class = 'ReduxFramework_' . $field['type'];
/**
* Field class file
*
//.........这里部分代码省略.........
示例5: __construct
/**
* Class Constructor. Defines the args for the extions class
*
* @since 1.0.0
* @access public
*
* @param array $sections Panel sections.
* @param array $args Class constructor arguments.
* @param array $extra_tabs Extra panel tabs.
*
* @return void
*/
public function __construct($parent)
{
$this->parent = $parent;
$this->filesystem = $this->parent->filesystem->execute('object');
$this->upload_dir = ReduxFramework::$_upload_dir . 'custom-fonts/';
// $upload['basedir'] . '/redux_custom_fonts/';
$this->upload_url = ReduxFramework::$_upload_url . 'custom-fonts/';
// $upload['baseurl'] . '/redux_custom_fonts/';
//echo substr(sprintf('%o', fileperms($this->upload_dir )), -4);
$this->getFonts();
if (file_exists($this->upload_dir . 'fonts.css')) {
if (filemtime($this->upload_dir . 'custom') > filemtime($this->upload_dir . 'fonts.css') + 10) {
//echo "regen existing file";
$this->generateCSS();
}
} else {
//echo "create non existing file";
$this->generateCSS();
}
if (empty($this->extension_dir)) {
$this->extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__)));
}
$this->field_name = 'custom_fonts';
self::$theInstance = $this;
// Adds the local field
add_filter('redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path'));
add_action('wp_ajax_redux_custom_fonts', array($this, 'ajax'));
//$this->ajax();
//add_action( 'wp_ajax_nopriv_redux_custom_fonts', array(
// $this,
// 'ajax'
//) );
add_filter("redux/{$this->parent->args['opt_name']}/field/typography/custom_fonts", array($this, 'addCustomFonts'));
$this->is_field = Redux_Helpers::isFieldInUse($parent, 'custom_fonts');
if (!$this->is_field) {
$this->add_section();
}
//require_once 'System.php'; // Wordpress core file
//if ( class_exists('System') === true ) {
add_filter('upload_mimes', array($this, 'custom_upload_mimes'));
//}
add_action('wp_head', array($this, '_enqueue_output'), 150);
add_filter('tiny_mce_before_init', array($this, 'extend_tinymce_dropdown'));
}
示例6: __construct
/**
* Class Constructor. Defines the args for the extions class
*
* @since 1.0.0
* @access public
*
* @param array $sections Panel sections.
* @param array $args Class constructor arguments.
* @param array $extra_tabs Extra panel tabs.
*
* @return void
*/
public function __construct($parent)
{
$this->parent = $parent;
$this->upload_dir = ReduxFramework::$_upload_dir . 'custom-fonts/';
$this->upload_url = ReduxFramework::$_upload_url . 'custom-fonts/';
if (!is_dir($this->upload_dir)) {
$this->parent->filesystem->execute('mkdir', $this->upload_dir);
}
if (!is_dir($this->upload_dir . '/custom')) {
$this->parent->filesystem->execute('mkdir', $this->upload_dir . '/custom');
}
$this->getFonts();
if (file_exists($this->upload_dir . 'fonts.css')) {
if (filemtime($this->upload_dir . 'custom') > filemtime($this->upload_dir . 'fonts.css') + 10) {
$this->generateCSS();
}
} else {
$this->generateCSS();
}
if (empty($this->extension_dir)) {
$this->extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__)));
}
$this->field_name = 'custom_fonts';
self::$theInstance = $this;
// Adds the local field
add_filter('redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path'));
add_action('wp_ajax_redux_custom_fonts', array($this, 'ajax'));
add_action('wp_ajax_redux_custom_font_timer', array($this, 'timer'));
add_filter("redux/{$this->parent->args['opt_name']}/field/typography/custom_fonts", array($this, 'addCustomFonts'));
$this->is_field = Redux_Helpers::isFieldInUse($parent, 'custom_fonts');
if (!$this->is_field) {
$this->add_section();
}
//$this->dynamic_section();
add_filter("redux/options/{$this->parent->args['opt_name']}/section/redux_dynamic_font_control", array($this, 'remove_dynamic_section'));
add_filter('upload_mimes', array($this, 'custom_upload_mimes'));
add_action('wp_head', array($this, '_enqueue_output'), 150);
add_filter('tiny_mce_before_init', array($this, 'extend_tinymce_dropdown'));
}