本文整理汇总了PHP中Redux_Helpers::isFieldInUseByType方法的典型用法代码示例。如果您正苦于以下问题:PHP Redux_Helpers::isFieldInUseByType方法的具体用法?PHP Redux_Helpers::isFieldInUseByType怎么用?PHP Redux_Helpers::isFieldInUseByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redux_Helpers
的用法示例。
在下文中一共展示了Redux_Helpers::isFieldInUseByType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _enqueue
/**
* Enqueue CSS/JS for options page
*
* @since 1.0.0
* @access public
* @global $wp_styles
* @return void
*/
public function _enqueue()
{
global $wp_styles;
Redux_Functions::$_parent = $this;
$min = Redux_Functions::isMin();
// Select2 business. Fields: Background, Border, Dimensions, Select, Slider, Typography
$field_arr = array('background', 'border', 'dimensions', 'select', 'select_image', 'slider', 'spacing', 'typography', 'color_scheme', 'css_layout');
if (Redux_Helpers::isFieldInUseByType($this->fields, $field_arr)) {
// select2 CSS
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_enqueue_style('select2-css');
// JS
wp_register_script('redux-select2-sortable-js', self::$_url . 'assets/js/vendor/redux.select2.sortable' . $min . '.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor/redux.select2.sortable' . $min . '.js'), true);
wp_register_script('select2-js', self::$_url . 'assets/js/vendor/select2/select2.min.js', array('jquery', 'redux-select2-sortable-js'), filemtime(self::$_dir . 'assets/js/vendor/select2/select2.min.js'), true);
wp_enqueue_script('select2-js');
}
redux_enqueue_style($this, 'redux-admin-css', self::$_url . 'assets/css/redux-admin.css', self::$_dir . 'assets/css/', array('farbtastic'), time(), 'all');
// wp_enqueue_style(
// 'redux-css',
// self::$_url . 'assets/css/redux.css',
// array( 'farbtastic' ),
// filemtime( self::$_dir . 'assets/css/redux.css' ),
// 'all'
// );
//
// wp_register_style(
// 'admin-css',
// self::$_url . 'assets/css/admin.css',
// array( 'farbtastic' ),
// filemtime( self::$_dir . 'assets/css/admin.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('qtip-css', self::$_url . 'assets/css/vendor/qtip/jquery.qtip.css', array(), filemtime(self::$_dir . 'assets/css/vendor/qtip/jquery.qtip.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('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', array('redux-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-dialog');
// Load jQuery sortable for slides, sorter, sortable and group
if (Redux_Helpers::isFieldInUseByType($this->fields, array('slides', 'sorter', 'sortable', 'group'))) {
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_style('jquery-ui-sortable');
}
// Load jQuery UI Datepicker for date
if (Redux_Helpers::isFieldInUseByType($this->fields, array('date', 'datetime'))) {
wp_enqueue_script('jquery-ui-datepicker');
}
// Load jQuery UI Accordion for slides and group
if (Redux_Helpers::isFieldInUseByType($this->fields, array('slides', 'group'))) {
wp_enqueue_script('jquery-ui-accordion');
}
// Load wp-color-picker for color, color_gradient, link_color, border, background and typography
if (Redux_Helpers::isFieldInUseByType($this->fields, array('background', 'color', 'color_gradient', 'link_color', 'border', 'typography', 'css_layout'))) {
redux_enqueue_style($this, 'redux-color-picker-css', ReduxFramework::$_url . 'assets/css/color-picker/color-picker.css', ReduxFramework::$_dir . 'assets/css/color-picker', array(), time(), false);
// wp_enqueue_style(
// 'redux-color-picker-css',
// self::$_url . 'assets/css/color-picker/color-picker.css',
// array( 'wp-color-picker' ),
// filemtime( self::$_dir . 'assets/css/color-picker/color-picker.css' ),
// 'all'
// );
wp_enqueue_style('color-picker-css');
wp_enqueue_script('wp-color-picker');
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('qtip-js', self::$_url . 'assets/js/vendor/qtip/jquery.qtip.js', array('jquery'), '2.2.0', true);
wp_register_script('serializeForm-js', self::$_url . 'assets/js/vendor/jquery.serializeForm.js', array('jquery'), '1.0.0', true);
// Embed the compress version unless in dev mode
// dev_mode = true
//.........这里部分代码省略.........
示例2: _enqueue
/**
* Enqueue CSS/JS for options page
*
* @since 1.0.0
* @access public
* @global $wp_styles
* @return void
*/
public function _enqueue()
{
global $wp_styles;
Redux_Functions::$_parent = $this;
$min = Redux_Functions::isMin();
// Select2 business. Fields: Background, Border, Dimensions, Select, Slider, Typography
if (Redux_Helpers::isFieldInUseByType($this->fields, array('background', 'border', 'dimensions', 'select', 'slider', 'typography'))) {
// select2 CSS
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_enqueue_style('select2-css');
// JS
wp_register_script('select2-sortable-js', self::$_url . 'assets/js/vendor/select2.sortable.min.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor/select2.sortable.min.js'), true);
wp_register_script('select2-js', self::$_url . 'assets/js/vendor/select2/select2.min.js', array('jquery', 'select2-sortable-js'), filemtime(self::$_dir . 'assets/js/vendor/select2/select2.min.js'), true);
wp_enqueue_script('select2-js');
}
wp_register_style('redux-css', self::$_url . 'assets/css/redux.css', array('farbtastic'), filemtime(self::$_dir . 'assets/css/redux.css'), 'all');
wp_register_style('admin-css', self::$_url . 'assets/css/admin.css', array('farbtastic'), filemtime(self::$_dir . 'assets/css/admin.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('qtip-css', self::$_url . 'assets/css/vendor/qtip/jquery.qtip.css', array(), filemtime(self::$_dir . 'assets/css/vendor/qtip/jquery.qtip.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('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-dialog');
// Load jQuery sortable for slides, sorter, sortable and group
if (Redux_Helpers::isFieldInUseByType($this->fields, array('slides', 'sorter', 'sortable', 'group'))) {
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_style('jquery-ui-sortable');
}
// Load jQuery UI Datepicker for date
if (Redux_Helpers::isFieldInUseByType($this->fields, array('date'))) {
wp_enqueue_script('jquery-ui-datepicker');
}
// Load jQuery UI Accordion for slides and group
if (Redux_Helpers::isFieldInUseByType($this->fields, array('slides', 'group'))) {
wp_enqueue_script('jquery-ui-accordion');
}
// Load wp-color-picker for color, color_gradient, link_color, border, and typography
if (Redux_Helpers::isFieldInUseByType($this->fields, array('color', 'color_gradient', 'link_color', 'border', 'typography'))) {
wp_enqueue_script('wp-color-picker');
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('qtip-js', self::$_url . 'assets/js/vendor/qtip/jquery.qtip.js', array('jquery'), '2.2.0', true);
wp_register_script('serializeForm-js', self::$_url . 'assets/js/vendor/jquery.serializeForm.js', array('jquery'), '1.0.0', true);
// Embed the compress version unless in dev mode
// dev_mode = true
if (isset($this->args['dev_mode']) && $this->args['dev_mode'] === true) {
wp_enqueue_style('admin-css');
wp_register_script('redux-vendor', self::$_url . 'assets/js/vendor.min.js', array('jquery'), filemtime(self::$_dir . 'assets/js/vendor.min.js'), true);
// dev_mode - false
} else {
wp_enqueue_style('redux-css');
}
$depArray = array('jquery', 'qtip-js', 'serializeForm-js');
if (true === $this->args['dev_mode']) {
array_push($depArray, 'redux-vendor');
}
wp_register_script('redux-js', self::$_url . 'assets/js/redux' . $min . '.js', $depArray, 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') {
$field_class = 'ReduxFramework_' . $field['type'];
/**
* Field class file
*
* filter 'redux/{opt_name}/field/class/{field.type}
* @param string field class file path
* @param array $field field config data
//.........这里部分代码省略.........