本文整理汇总了PHP中ReduxFramework类的典型用法代码示例。如果您正苦于以下问题:PHP ReduxFramework类的具体用法?PHP ReduxFramework怎么用?PHP ReduxFramework使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ReduxFramework类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: load
public function load()
{
$redux = new ReduxFramework();
$redux->init();
//if ( ! empty( $redux ) ) {
$dir = ReduxFramework::$_dir . '../';
if (!ReduxFramework::$_is_plugin) {
$errors = array();
if (file_exists($dir . '.tx')) {
$errors[] = ".tx/";
}
if (file_exists($dir . 'bin')) {
$errors[] = "bin/";
}
if (file_exists($dir . 'tests')) {
$errors[] = "tests/";
}
if (file_exists($dir . '.gitignore')) {
$errors[] = ".gitignore";
}
if (file_exists($dir . '.git')) {
$errors[] = ".git/";
}
if (file_exists($dir . 'node_modules')) {
$errors[] = "node_modules/";
}
if (file_exists($dir . '.travis.yml')) {
$errors[] = ".travis.yml";
}
if (file_exists($dir . 'bootstrap_tests.php')) {
$errors[] = "bootstrap_tests.php";
}
if (file_exists($dir . 'phpunit.xml')) {
$errors[] = "phpunit.xml";
}
if (file_exists($dir . '.ds_store')) {
$errors[] = ".ds_store";
}
if (file_exists($dir . 'codestyles')) {
$errors[] = "codestyles/";
}
if (!empty($errors)) {
?>
<div class="error">
<p><?php
echo 'The following directories & files are still located in your <strong>Redux</strong> directory. They may cause errors in Theme-Check.';
echo '<br /><ul style="margin-left:15px;">';
foreach ($errors as $error) {
echo '<li><strong>~/' . $error . '</strong></li>';
}
?>
</ul></p></div><?php
}
}
}
开发者ID:rinodung,项目名称:live-theme,代码行数:55,代码来源:class.redux_themecheck.php
示例2: 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();
}
开发者ID:Bitcoinsulting,项目名称:website-ads,代码行数:14,代码来源:field_spinner.php
示例3:
/**
* 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();
}
开发者ID:neocreo,项目名称:brew,代码行数:15,代码来源:validation_html.php
示例4: 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();
}
开发者ID:87surendra,项目名称:mbr,代码行数:15,代码来源:field_typography.php
示例5: 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 special characters in this field, all special characters have been removed.', 'redux-framework');
$this->value = $value;
$this->current = $current;
$this->validate();
}
开发者ID:dreadfra,项目名称:superba,代码行数:16,代码来源:validation_no_special_chars.php
示例6: 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();
}
开发者ID:neocreo,项目名称:brew,代码行数:16,代码来源:validation_color_rgba.php
示例7: __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)
{
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']);
}
}
开发者ID:sissisnothere,项目名称:testWeb,代码行数:27,代码来源:field_select.php
示例8: includes
/**
* Include necessary files
*
* @access public
* @since 3.1.3
* @return void
*/
public function includes()
{
// Include ReduxCore
if (file_exists(dirname(__FILE__) . '/ReduxCore/framework.php')) {
require_once dirname(__FILE__) . '/ReduxCore/framework.php';
}
if (isset(ReduxFramework::$_as_plugin)) {
ReduxFramework::$_as_plugin = true;
}
if (file_exists(dirname(__FILE__) . '/ReduxCore/redux-extensions/config.php')) {
require_once dirname(__FILE__) . '/ReduxCore/redux-extensions/config.php';
}
// Include demo config, if demo mode is active
if ($this->options['demo'] && file_exists(dirname(__FILE__) . '/sample/sample-config.php')) {
require_once dirname(__FILE__) . '/sample/sample-config.php';
}
}
开发者ID:un1coin,项目名称:ovn-space,代码行数:24,代码来源:class.redux-plugin.php
示例9: addPanel
public function addPanel()
{
$this->version = OT_VERSION;
$sections = $this->getSections();
$this->data = get_option('option_tree');
if (!empty($sections) && class_exists('ReduxFramework')) {
$args = array('opt_name' => $this->framework . '2Redux_Panel', 'save_defaults' => false, 'menu_title' => $this->framework . ' 2 Redux', 'output' => false, 'show_import_export' => false, 'page_slug' => $this->framework . 'Redux_Converter', 'enqueue' => false, 'intro_text' => '<p>This is your panel converted. Saving will be saved to a transient value which gets reset every hour. <a href="./admin.php?page=' . $this->framework . '_2_redux">Proceed here</a> to get the export code you would need to migrate from ' . $this->framework . ' to Redux.</p>');
$theme = wp_get_theme();
$args['display_name'] = $theme->get('Name');
$args['display_version'] = $theme->get('Version');
$args['google_api_key'] = 'AIzaSyAX_2L_UzCDPEnAHTG7zhESRVpMPS4ssII';
$sections[] = array('type' => 'divide');
$sections[] = array('title' => 'Convert to Redux!', 'icon' => 'el-icon-asl', 'fields' => array(array('id' => 'redux_conversion_welcome', 'type' => 'info', 'title' => __("Rest assured, you're making the right choice.", 'redux-framework-demo'), 'desc' => "Converting to a new framework is not always easy, in fact it's downright <strong>painful</strong>. We don't think it has to be that way. That's why we created this converter plugin.<br /><br />Fill out the items below and download a fully function Redux Framework class. <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3WQGEY4NSYE38' target='_blank'>Be sure to donate</a>. Every bit helps."), array('id' => 'redux_convert_refresh_data', 'type' => 'checkbox', 'title' => __('Reset Panel to Old Data', 'redux-framework-demo'), 'subtitle' => __('Reset this panel to match what is inside ' . $this->framework . '.', 'redux-framework-demo'), 'options' => array(1 => 'Reset this panel to match what is stored in ' . $this->framework . '.')), array('id' => 'redux_opt_name', 'type' => 'text', 'title' => __('Database name, aka Redux opt_name', 'redux-framework-demo'), 'subtitle' => __('Choose the place where your data will be stored in the database.', 'redux-framework-demo'), 'desc' => 'Once this is specified, Redux will take care of the rest. It is suggested to use a different key than you previously had. Data migration code will be provided.', 'default' => 'redux_converter'), array('id' => 'redux_convert_data', 'type' => 'switch', 'title' => __('Add Data Migration', 'redux-framework-demo'), 'subtitle' => __('Don\'t just implement a new panel, but migrate your old data as well.', 'redux-framework-demo'), 'default' => 1, 'desc' => 'A function will be provided which will, on theme activation/upgrade, migrate your data to your new Redux opt_name location denoted above. This makes it super easy to convert even if you have many users! <span style="color: maroon;">Please verify data migrates properly. Redux takes no responsibility if a field does not convert as it should.</span> If you find a bug, <a href="https://github.com/ReduxFramework/redux-converter/issues" target="_blank">please submit it to us</a>!'), array('id' => 'redux_global_variable', 'type' => 'text', 'title' => __('Redux Global Variable', 'redux-framework-demo'), 'subtitle' => __('Redux provides a global variable for your access your panel data anywhere within wordpress.', 'redux-converter'), 'desc' => 'By default the global variable is the same as the opt_name. If you want it to be something else (or your old variable), choose a name here. All standard variable rules apply (no spaces, dashes, or other odd symbols). ' . $this->framework . '\'s typical variables (if you wanted to keep your code as is) are $data or $smof_data.'), array('id' => 'redux_delete_old_data', 'type' => 'checkbox', 'title' => __('Delete Old Panel Data?', 'redux-framework-demo'), 'subtitle' => __('We strongly suggest you don\'t do this, but it is your choice.', 'redux-framework-demo'), 'desc' => '<span style="color: red;">There is no undoing this. If something in the conversion goes bad, your previously set data will be lost. It is suggested to leave this be just in case.</span>', 'options' => array(1 => 'Remove old data on migration')), array('id' => 'redux_download_file', 'type' => 'raw', 'content' => '<center><input type="hidden" class="convertToReduxNonce" value="' . wp_create_nonce('convertToRedux' . $this->framework) . '"><a href="#" target="_blank" class="button button-primary redux-converter-action">View Redux Config File</a> <a href="#" data-action="download" class="button button-primary redux-converter-action">Download Redux Config File</a></center>')));
$ReduxFramework = new ReduxFramework($sections, $args);
//print_r(get_option( 'option_tree' ));
//print_r(ot_get_option('my_category_checkbox'));
//echo ot_get_option('my_category_checkbox');
$convertData = false;
if (empty($ReduxFramework->options) || isset($ReduxFramework->options['redux_convert_refresh_data']) && $ReduxFramework->options['redux_convert_refresh_data'] == 1) {
$convertData = true;
$ReduxFramework->options = get_option('option_tree');
}
foreach ($sections as $section) {
if (isset($section['fields'])) {
foreach ($section['fields'] as $field) {
if ($convertData && isset($ReduxFramework->options[$field['id']]) && !empty($ReduxFramework->options[$field['id']])) {
$ReduxFramework->options[$field['id']] = $this->convertValue($ReduxFramework->options[$field['id']], $field);
// Not sure why this happens. Huh.
}
if (isset($field['required'])) {
$ReduxFramework->get_fold($field);
}
}
}
}
}
}
开发者ID:janealambd,项目名称:redux-converter,代码行数:37,代码来源:class.converter.OptionTree.php
示例10: init
public static function init()
{
global $wp_filesystem;
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = self::$wp_content_url . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
// Create our private upload directory
Redux_Functions::initWpFilesystem();
self::$_upload_dir = trailingslashit($wp_filesystem->wp_content_dir()) . '/redux/';
self::$_upload_url = trailingslashit(content_url()) . '/redux/';
if (function_exists('sys_get_temp_dir')) {
$tmp = sys_get_temp_dir();
if (empty($tmp)) {
$tmpDir = self::$_upload_url . 'tmp';
if (file_exists($tmpDir)) {
Redux_Helpers::rmdir($tmpDir);
}
putenv('TMPDIR=' . self::$_upload_dir . 'tmp');
}
}
// Ensure it exists
if (!is_dir(self::$_upload_dir)) {
// Create the directory
$wp_filesystem->mkdir(self::$_upload_dir);
}
}
开发者ID:Ahmed-dawoud,项目名称:care4u,代码行数:34,代码来源:framework.php
示例11: init
static function init()
{
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = self::$wp_content_url . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
// Create our private upload directory
$upload = wp_upload_dir();
self::$_upload_dir = Redux_Helpers::cleanFilePath($upload['basedir']) . '/redux/';
self::$_upload_url = Redux_Helpers::cleanFilePath($upload['baseurl']) . '/redux/';
// Ensure it exists
if (!is_dir(self::$_upload_dir)) {
global $wp_filesystem;
// Init wp_filesystem
Redux_Functions::initWpFilesystem();
// Create the directory
$wp_filesystem->mkdir(self::$_upload_dir);
}
}
开发者ID:6226,项目名称:wp,代码行数:26,代码来源:framework.php
示例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);
$this->field = $field;
$this->value = $value;
$this->parent = $parent;
}
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:16,代码来源:field_group.php
示例13: init
static function init()
{
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
$wp_content_url = Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL);
self::$_url = trailingslashit($wp_content_url) . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
/**
Still need to port these.
$defaults['footer_credit'] = '<span id="footer-thankyou">' . __( 'Options panel created using', 'redux-framework') . ' <a href="' . $this->framework_url . '" target="_blank">' . __('Redux Framework', 'redux-framework') . '</a> v' . self::$_version . '</span>';
$defaults['help_tabs'] = array();
$defaults['help_sidebar'] = ''; // __( '', 'redux-framework' );
$defaults['database'] = ''; // possible: options, theme_mods, theme_mods_expanded, transient
$defaults['customizer'] = false; // setting to true forces get_theme_mod_expanded
$defaults['global_variable'] = '';
$defaults['output'] = true; // Dynamically generate CSS
$defaults['transient_time'] = 60 * MINUTE_IN_SECONDS;
// The defaults are set so it will preserve the old behavior.
$defaults['default_show'] = false; // If true, it shows the default value
$defaults['default_mark'] = ''; // What to print by the field's title if the value shown is default
**/
self::$_properties = array('args' => array('opt_name' => array('required', 'data_type' => 'string', 'label' => 'Option Name', 'desc' => 'Must be defined by theme/plugin. Is the unique key allowing multiple instance of Redux within a single Wordpress instance.', 'default' => ''), 'google_api_key' => array('data_type' => 'string', 'label' => 'Google Web Fonts API Key', 'desc' => 'Key used to request Google Webfonts. Google fonts are omitted without this.', 'default' => ''), 'last_tab' => array('data_type' => 'string', 'label' => 'Last Tab', 'desc' => 'Last tab used.', 'default' => '0'), 'menu_icon' => array('data_type' => 'string', 'label' => 'Default Menu Icon', 'desc' => 'Default menu icon used by sections when one is not specified.', 'default' => self::$_url . 'assets/img/menu_icon.png'), 'menu_title' => array('data_type' => 'string', 'label' => 'Menu Title', 'desc' => 'Label displayed when the admin menu is available.', 'default' => __('Options', 'redux-framework')), 'page_title' => array('data_type' => 'string', 'label' => 'Page Title', 'desc' => 'Title used on the panel page.', 'default' => __('Options', 'redux-framework')), 'page_icon' => array('data_type' => 'string', 'label' => 'Page Title', 'desc' => 'Icon class to be used on the options page.', 'default' => 'icon-themes'), 'page_slug' => array('required', 'data_type' => 'string', 'label' => 'Page Slug', 'desc' => 'Slug used to access options panel.', 'default' => '_options'), 'page_permissions' => array('required', 'data_type' => 'string', 'label' => 'Page Capabilities', 'desc' => 'Permissions needed to access the options panel.', 'default' => 'manage_options'), 'menu_type' => array('required', 'data_type' => 'varchar', 'label' => 'Page Type', 'desc' => 'Specify if the admin menu should appear or not.', 'default' => 'menu', 'form' => array('type' => 'select', 'options' => array('menu' => 'Admin Menu', 'submenu' => 'Submenu Only')), 'validation' => array('required')), 'page_parent' => array('required', 'data_type' => 'varchar', 'label' => 'Page Parent', 'desc' => 'Specify if the admin menu should appear or not.', 'default' => 'themes.php', 'form' => array('type' => 'select', 'options' => array('index.php' => 'Dashboard', 'edit.php' => 'Posts', 'upload.php' => 'Media', 'link-manager.php' => 'Links', 'edit.php?post_type=page' => 'pages', 'edit-comments.php' => 'Comments', 'themes.php' => 'Appearance', 'plugins.php' => 'Plugins', 'users.php' => 'Users', 'tools.php' => 'Tools', 'options-general.php' => 'Settings')), 'validation' => array('required')), 'page_priority' => array('type' => 'int', 'label' => 'Page Position', 'desc' => 'Location where this menu item will appear in the admin menu. Warning, beware of overrides.', 'default' => null), 'output' => array('required', 'data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Output/Generate CSS', 'desc' => 'Global shut-off for dynamic CSS output by the framework', 'default' => true), 'allow_sub_menu' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Allow Submenu', 'desc' => 'Turn on or off the submenu that will typically be shown under Appearance.', 'default' => true), 'show_import_export' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Show', false => 'Hide')), 'label' => 'Show Import/Export', 'desc' => 'Show/Hide the import/export tab.', 'default' => true), 'dev_mode' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Developer Mode', 'desc' => 'Turn on or off the dev mode tab.', 'default' => false), 'system_info' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'System Info', 'desc' => 'Turn on or off the system info tab.', 'default' => false)));
}
开发者ID:patlegris,项目名称:angularpresstheme,代码行数:31,代码来源:framework.php
示例14: __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;
}
开发者ID:mdb-webdev,项目名称:ReduxCore,代码行数:17,代码来源:field_multi_text.php
示例15: 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'];
}
}
开发者ID:Bitcoinsulting,项目名称:website-ads,代码行数:14,代码来源:field_sorter.php
示例16: init
static function init()
{
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = '/themeoptions/';
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = get_template_directory_uri() . $relative_url;
}
开发者ID:pradeep-web,项目名称:brandt,代码行数:10,代码来源:framework.php
示例17: __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']);
}
}
开发者ID:87surendra,项目名称:mbr,代码行数:21,代码来源:field_checkbox.php
示例18: __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;
}
开发者ID:neocreo,项目名称:brew,代码行数:21,代码来源:field_edd_license.php
示例19: __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';
}
开发者ID:danielvdml,项目名称:quilqax,代码行数:22,代码来源:field_checkbox.php
示例20: init
static function init()
{
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = self::$wp_content_url . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
}
开发者ID:ArgiaCyber,项目名称:alfath,代码行数:14,代码来源:framework.php
注:本文中的ReduxFramework类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论