本文整理汇总了PHP中ReduxFramework::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ReduxFramework::__construct方法的具体用法?PHP ReduxFramework::__construct怎么用?PHP ReduxFramework::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReduxFramework
的用法示例。
在下文中一共展示了ReduxFramework::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($_sections = array(), $args = array(), $widget = null)
{
$args['dev_mode'] = false;
$args['global_variable'] = false;
if ($widget != null) {
$this->widget = $widget;
$sections[] = array('title' => '', 'fields' => $_sections);
add_filter('redux-support-group', array($this, 'field_support_group'), 1, 3);
} else {
$this->widget = null;
$sections = $_sections;
}
parent::__construct($sections, $args, $extra_tabs = array());
//check here if the field is availabe in ReduxPageBuilder fields folder
//otherwise load it from ReduxFramework fields directory
//remove_filter('redux-typeclass-load', 'add_extended_fields');
//add_filter('redux-typeclass-load' , array($this,'fields_dir'));
add_filter('redux/' . $args['opt_name'] . '/field/class/linkpicker', array($this, 'fields_dir'));
//add_filter('redux-field-'.$this->args['opt_name'] , array($this,'field_support_widget'),10,2);
add_filter('redux/field/' . $this->args['opt_name'] . '/render/after', array($this, 'field_support_widget'), 10, 2);
// Set option with defaults
$this->_set_default_options();
// Options page
$this->_options_page();
// Register setting
$this->_register_settings();
}
示例2: __construct
/**
* Field Constructor.
*
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
*
* @since 1.0.0
* @access public
* @return void
*/
public function __construct($field = array(), $value = '', $parent)
{
parent::__construct($parent->sections, $parent->args);
$this->field = $field;
$this->value = $value;
$this->parent = $parent;
}
示例3: array
/**
* Field Constructor.
*
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
*
* @since ReduxFramework 3.0.0
*/
function __construct($field = array(), $value = '', $parent)
{
parent::__construct($parent->sections, $parent->args);
$this->field = $field;
$this->value = $value;
//$this->render();
}
示例4:
/**
* 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, $value, $current)
{
parent::__construct();
$this->field = $field;
$this->value = $value;
$this->current = $current;
$this->validate();
}
示例5: array
/**
* 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)
{
parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
$this->field = $field;
$this->value = $value;
$this->googleAPIKey = $parent->args['google_api_key'];
//$this->render();
}
示例6: __construct
/**
* Field Constructor.
*
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
*
* @since 1.0.0
* @access public
* @return void
*/
public function __construct($field = array(), $value = '', $parent)
{
parent::__construct($parent->sections, $parent->args);
$this->field = $field;
$this->value = $value;
$this->add_text = isset($this->field['add_text']) ? $this->field['add_text'] : __('Add More', 'redux-framework');
$this->show_empty = isset($this->field['show_empty']) ? $this->field['show_empty'] : true;
}
示例7: isset
/**
* 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, $value, $current)
{
parent::__construct();
$this->field = $field;
$this->field['msg'] = isset($this->field['msg']) ? $this->field['msg'] : __('You must not enter any HTML in this field, all HTML tags have been removed.', 'redux');
$this->value = $value;
$this->current = $current;
$this->validate();
}
示例8: array
/**
* Field Constructor.
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
* @since Redux_Options 1.0.0
*/
function __construct($field = array(), $value = '', $parent)
{
parent::__construct($parent->sections, $parent->args);
$this->field = $field;
$this->value = $value;
if (!is_array($this->value) && isset($this->field['options'])) {
$this->value = $this->field['options'];
}
}
示例9: isset
/**
* Field Constructor.
*
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
*
* @since ReduxFramework 3.0.4
*/
function __construct($field, $value, $current)
{
parent::__construct();
$this->field = $field;
$this->field['msg'] = isset($this->field['msg']) ? $this->field['msg'] : __('This field must be a valid color value.', 'redux-framework');
$this->value = $value;
$this->current = $current;
$this->validate();
}
示例10: __construct
/**
* Field Constructor.
*
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
*
* @since 1.0.0
* @access public
* @return void
*/
public function __construct($field = array(), $value = '', $parent)
{
parent::__construct($parent->sections, $parent->args);
$this->field = $field;
$this->value = $value;
// Create defaults array
$defaults = array('mode' => '', 'path' => '', 'remote_api_url' => '', 'version' => '', 'item_name' => '', 'author' => '', 'mode' => '');
$this->field = wp_parse_args($this->field, $defaults);
$defaults = array('license' => '', 'status' => '');
$this->value = wp_parse_args($this->value, $defaults);
$this->parent = $parent;
}
示例11: __construct
/**
* Field Constructor.
*
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
*
* @since 1.0.0
* @access public
* @return void
*/
public function __construct($field = array(), $value = '', $parent)
{
parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
$this->field = $field;
$this->value = $value;
if (!empty($this->field['data']) && empty($this->field['options'])) {
if (empty($this->field['args'])) {
$this->field['args'] = array();
}
$this->field['options'] = $parent->get_wordpress_data($this->field['data'], $this->field['args']);
}
}
示例12: __construct
/**
* Field Constructor.
*
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
*
* @since 1.0.0
* @access public
* @return void
*/
public function __construct($field = array(), $value = '', $parent)
{
parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
$this->field = $field;
$this->value = $value;
if (!empty($this->field['data']) && empty($this->field['options'])) {
if (empty($this->field['args'])) {
$this->field['args'] = array();
}
$this->field['options'] = $parent->get_wordpress_data($this->field['data'], $this->field['args']);
}
$this->field['data_class'] = isset($this->field['multi_layout']) ? 'data-' . $this->field['multi_layout'] : 'data-full';
}
示例13: array
/**
* 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)
{
parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
$this->field = $field;
$this->value = $value;
//$this->render();
if (!empty($this->field['data']) && empty($this->field['options'])) {
if (empty($this->field['args'])) {
$this->field['args'] = array();
}
if ($this->field['data'] == "elusive-icons" || $this->field['data'] == "elusive-icon" || $this->field['data'] == "elusive") {
$icons_file = ReduxFramework::$_dir . 'inc/fields/select/fontawesome-icons.php';
$icons_file = apply_filters('redux-font-icons-file', $icons_file);
if (file_exists($icons_file)) {
require_once $icons_file;
}
}
$this->field['options'] = $parent->get_wordpress_data($this->field['data'], $this->field['args']);
}
}
示例14: __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)
{
global $pagenow;
if ($pagenow !== "customize.php" && $pagenow !== "admin-ajax.php") {
return;
}
if ($parent->args['customizer'] === false) {
return;
}
parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
// Create defaults array
$defaults = array();
/*
customize_controls_init
customize_controls_enqueue_scripts
customize_controls_print_styles
customize_controls_print_scripts
customize_controls_print_footer_scripts
*/
add_action('admin_init', array(&$this, '_enqueue'), 30);
// Customizer control scripts
add_action('customize_register', array(&$this, '_register_customizer_controls'));
// Create controls
add_action('wp_enqueue_scripts', array(&$this, '_enqueue_previewer_css'));
// Enqueue previewer css
add_action('wp_enqueue_scripts', array(&$this, '_enqueue_previewer_js'));
// Enqueue previewer javascript
add_action('customize_save', array(&$this, 'customizer_save_before'));
// Before save
add_action('customize_save_after', array(&$this, 'customizer_save_after'));
// After save
if (empty($this->extension_dir)) {
$this->extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__)));
$this->extension_url = site_url(str_replace(trailingslashit(str_replace('\\', '/', ABSPATH)), '', $this->extension_dir));
// Easier to read and less buggy way to find out correct url, but applicable
// only if wp-content found. Othewise fall back to old URL detection code.
if (preg_match("/wp-content\\/(.*)/", $this->extension_dir, $match)) {
$this->extension_url = site_url('/wp-content/' . $match[1]);
}
}
}
示例15: __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)
{
global $pagenow;
if ($pagenow !== "customize.php" && $pagenow !== "admin-ajax.php") {
return;
}
if ($parent->args['customizer'] === false) {
return;
}
parent::__construct($parent->sections, $parent->args, $parent->extra_tabs);
// Create defaults array
$defaults = array();
/*
customize_controls_init
customize_controls_enqueue_scripts
customize_controls_print_styles
customize_controls_print_scripts
customize_controls_print_footer_scripts
*/
add_action('admin_init', array(&$this, '_enqueue'), 30);
// Customizer control scripts
add_action('customize_register', array(&$this, '_register_customizer_controls'));
// Create controls
add_action('wp_enqueue_scripts', array(&$this, '_enqueue_previewer_css'));
// Enqueue previewer css
add_action('wp_enqueue_scripts', array(&$this, '_enqueue_previewer_js'));
// Enqueue previewer javascript
add_action('customize_save', array(&$this, 'customizer_save_before'));
// Before save
add_action('customize_save_after', array(&$this, 'customizer_save_after'));
// After save
if (empty($this->extension_dir)) {
$this->extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__)));
$this->extension_url = site_url(str_replace(trailingslashit(str_replace('\\', '/', ABSPATH)), '', $this->extension_dir));
}
}