本文整理汇总了PHP中Redux类的典型用法代码示例。如果您正苦于以下问题:PHP Redux类的具体用法?PHP Redux怎么用?PHP Redux使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Redux类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* ---> SET ARGUMENTS
* All the possible arguments for Redux.
* For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments
* */
$args = array('opt_name' => $opt_name, 'display_name' => 'Vehicle Booking System', 'display_version' => '1.0.0', 'menu_type' => 'submenu', 'allow_sub_menu' => false, 'menu_title' => __('VBS Options', 'vbs'), 'page_title' => __('Vehicle Booking Options', 'vbs'), 'google_api_key' => '', 'google_update_weekly' => false, 'async_typography' => true, 'admin_bar' => false, 'admin_bar_icon' => 'dashicons-portfolio', 'admin_bar_priority' => 50, 'global_variable' => '', 'dev_mode' => false, 'update_notice' => false, 'customizer' => false, 'page_priority' => null, 'page_parent' => 'vbs_admin_menu', 'page_permissions' => 'manage_options', 'menu_icon' => '', 'last_tab' => '', 'page_icon' => 'icon-themes', 'page_slug' => 'vbs_options', 'save_defaults' => true, 'default_show' => false, 'default_mark' => '', 'show_import_export' => true, 'transient_time' => 60 * MINUTE_IN_SECONDS, 'output' => true, 'output_tag' => true, 'database' => '', 'use_cdn' => false, 'hints' => array('icon' => 'fa fa-question', 'icon_position' => 'right', 'icon_color' => 'lightgray', 'icon_size' => 'normal', 'tip_style' => array('color' => 'light', 'shadow' => true, 'rounded' => false, 'style' => ''), 'tip_position' => array('my' => 'top left', 'at' => 'bottom right'), 'tip_effect' => array('show' => array('effect' => 'slide', 'duration' => '500', 'event' => 'mouseover'), 'hide' => array('effect' => 'slide', 'duration' => '500', 'event' => 'click mouseleave'))));
$args['share_icons'][] = array('url' => 'http://www.facebook.com/interactivedes', 'title' => 'Like us on Facebook', 'icon' => 'fa fa-facebook');
$args['share_icons'][] = array('url' => 'http://twitter.com/intera_design', 'title' => 'Follow us on Twitter', 'icon' => 'fa fa-twitter');
$args['share_icons'][] = array('url' => 'http://www.linkedin.com/companies/820832', 'title' => 'Find us on LinkedIn', 'icon' => 'fa fa-linkedin');
$args['share_icons'][] = array('url' => 'http://github.com/gnikolopoulos', 'title' => 'Find us on GitHub', 'icon' => 'fa fa-github');
// Add content after the form.
$args['footer_text'] = __('<p>Development by <a href="http://interactive-design.gr" target="_blank" >Interactive Design | creative studio</a></p>', 'vbs');
Redux::setArgs($opt_name, $args);
/*
* ---> END ARGUMENTS
*/
/*
*
* ---> START SECTIONS
*
*/
Redux::setSection($opt_name, array('title' => __('General', 'vbs'), 'id' => 'opt-general', 'icon' => 'fa fa-cogs', 'fields' => array(array('id' => 'use_base', 'type' => 'switch', 'title' => __('Use base Location', 'vbs'), 'default' => true), array('id' => 'base_location', 'type' => 'text', 'title' => __('Set your base location', 'vbs'), 'default' => 'Pl. Sintagmatos, Athina 105 63, Greece'), array('id' => 'currency_symbol', 'type' => 'text', 'title' => __('Set Currency symbol', 'vbs'), 'default' => '€'))));
Redux::setSection($opt_name, array('title' => __('Styling', 'vbs'), 'id' => 'opt-styling', 'icon' => 'fa fa-paint-brush', 'fields' => array(array('id' => 'form_style', 'type' => 'button_set', 'title' => __('Form Style', 'vbs'), 'options' => array('stacked' => 'Stacked', 'horizontal' => 'Horizontal'), 'default' => 'stacked'))));
Redux::setSection($opt_name, array('title' => __('PayPal', 'vbs'), 'id' => 'opt-paypal', 'icon' => 'fa fa-paypal', 'fields' => array(array('id' => 'paypal_email', 'type' => 'text', 'title' => __('PayPal email', 'vbs'), 'default' => 'example@example.com', 'validate' => 'email'), array('id' => 'paypal_mode', 'type' => 'switch', 'title' => __('Sandbox mode', 'vbs'), 'subtitle' => __('Enable PayPal Sandbox mode', 'vbs'), 'default' => true), array('id' => 'business_name', 'type' => 'text', 'title' => __('Will appear on the PayPal form', 'vbs'), 'default' => 'Your Company LLC.'), array('id' => 'currency_code', 'type' => 'text', 'title' => __('Currency', 'vbs'), 'default' => 'USD'), array('id' => 'return_page', 'type' => 'select', 'title' => __('Page to return to after transaction', 'vbs'), 'data' => 'pages'))));
Redux::setSection($opt_name, array('title' => __('Email', 'vbs'), 'id' => 'opt-email', 'icon' => 'fa fa-envelope', 'fields' => array(array('id' => 'default_email', 'type' => 'text', 'title' => __('Email to be used as the From: field', 'vbs'), 'default' => 'example@example.com', 'validate' => 'email'), array('id' => 'email_mode', 'type' => 'switch', 'title' => __('Use PHP mailer?', 'vbs'), 'subtitle' => __('Use PHP Mailer instead of wp_mail()', 'vbs'), 'default' => true))));
Redux::setSection($opt_name, array('title' => __('PHP Mailer', 'vbs'), 'desc' => __('Only needed when you don\'t want to use wp_mail()', 'vbs'), 'id' => 'opt-mailer', 'icon' => 'fa fa-paper-plane', 'fields' => array(array('id' => 'smtp_host', 'type' => 'text', 'title' => __('SMTP Host', 'vbs'), 'default' => 'mail.example.com'), array('id' => 'smtp_port', 'type' => 'text', 'title' => __('SMTP Port', 'vbs'), 'default' => '25'), array('id' => 'smtp_auth', 'type' => 'switch', 'title' => __('SMTP requires authentication?', 'vbs'), 'default' => true), array('id' => 'smtp_secure', 'type' => 'radio', 'title' => __('Use SSL/TLS?', 'vbs'), 'options' => array('none' => 'None', 'ssl' => 'Use SSL', 'tls' => 'Use TLS'), 'default' => 'none'), array('id' => 'smtp_login', 'type' => 'password', 'username' => true, 'title' => 'SMTP Account', 'placeholder' => array('username' => 'SMTP username', 'password' => 'SMTP Password')))));
Redux::setSection($opt_name, array('title' => __('Email Template', 'vbs'), 'id' => 'opt-template', 'icon' => 'fa fa-columns', 'fields' => array(array('id' => 'email_logo', 'type' => 'media', 'url' => true, 'title' => __('Logo image', 'vbs'), 'subtitle' => __('140x50px', 'vbs'), 'default' => array('url' => PLUGIN_DIR_URL . 'templates/default/img/logo.jpg')), array('id' => 'email_banner', 'type' => 'media', 'url' => true, 'title' => __('Heading image', 'vbs'), 'subtitle' => __('600x300px', 'vbs'), 'default' => array('url' => PLUGIN_DIR_URL . 'templates/default/img/banner.jpg')), array('id' => 'email_template', 'type' => 'text', 'title' => __('Folder name that contains the mail template', 'vbs'), 'subtitle' => __('Must be under the /templates folder', 'vbs'), 'default' => 'default'), array('id' => 'email_title', 'type' => 'text', 'title' => __('Email title/Subject', 'vbs'), 'default' => 'Your booking details'), array('id' => 'email_heading', 'type' => 'text', 'title' => __('Header text for notification emails', 'vbs'), 'default' => 'Thank you for booking with us!'), array('id' => 'email_intro', 'type' => 'textarea', 'title' => __('Email intro text', 'vbs'), 'subtitle' => __('No HTML allowed', 'vbs'), 'default' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod Tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo', 'validate' => 'no_html'))));
Redux::setSection($opt_name, array('title' => __('Social', 'vbs'), 'id' => 'opt-social', 'icon' => 'fa fa-share-alt', 'fields' => array(array('id' => 'facebook_url', 'type' => 'text', 'title' => __('Your Facebook page/profile URL', 'vbs'), 'default' => 'http://facebook.com', 'validate' => 'url'), array('id' => 'linkedin_url', 'type' => 'text', 'title' => __('Your LinkedIn profile URL', 'vbs'), 'default' => 'http://linkedin.com', 'validate' => 'url'), array('id' => 'twitter_url', 'type' => 'text', 'title' => __('Your Twitter profile URL', 'vbs'), 'default' => 'http://twitter.com', 'validate' => 'url'))));
/*
* <--- END SECTIONS
*/
示例2: add_options
static function add_options()
{
$opt_name = "webidia_framework_opts";
$args = array('opt_name' => $opt_name, 'use_cdn' => TRUE, 'display_name' => 'Webidia Framework Options', 'display_version' => FALSE, 'page_title' => 'Webidia Framework Options', 'update_notice' => TRUE, 'intro_text' => '', 'footer_text' => '', 'menu_type' => 'submenu', 'allow_sub_menu' => TRUE, 'menu_title' => 'Options', 'page_parent' => 'webidia-framework', 'customizer' => TRUE, 'admin_bar' => FALSE, 'dev_mode' => FALSE, 'default_mark' => '*', 'hints' => array('icon_position' => 'right', 'icon_color' => 'lightgray', 'icon_size' => 'normal', 'tip_style' => array('color' => 'light'), 'tip_position' => array('my' => 'top left', 'at' => 'bottom right'), 'tip_effect' => array('show' => array('duration' => '500', 'event' => 'mouseover'), 'hide' => array('duration' => '500', 'event' => 'mouseleave unfocus'))), 'output' => TRUE, 'output_tag' => TRUE, 'settings_api' => TRUE, 'cdn_check_time' => '1440', 'compiler' => TRUE, 'page_permissions' => 'manage_options', 'save_defaults' => TRUE, 'show_import_export' => TRUE, 'database' => 'options', 'transient_time' => '3600', 'network_sites' => TRUE);
Redux::setArgs($opt_name, $args);
$tabs = array(array('id' => 'redux-help-tab-1', 'title' => __('Theme Information 1', 'admin_folder'), 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'admin_folder')), array('id' => 'redux-help-tab-2', 'title' => __('Theme Information 2', 'admin_folder'), 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'admin_folder')));
Redux::setHelpTab($opt_name, $tabs);
$content = __('<p>This is the sidebar content, HTML is allowed.</p>', 'admin_folder');
Redux::setHelpSidebar($opt_name, $content);
Redux::setSection($opt_name, array('title' => __('Plugins', 'webidia-builder'), 'desc' => '', 'subsection' => false, 'icon' => 'el el-icon-adjust-alt', 'fields' => array(array('id' => 'wf_options_general_basic_smoothscroll', 'type' => 'switch', 'title' => __('Smooth Scroll', 'webidia_framework'), 'subtitle' => __('', 'webidia_framework'), 'default' => true, 'on' => 'Enabled', 'off' => 'Disabled'), array('id' => 'wf_options_general_basic_animations', 'type' => 'switch', 'title' => __('Animations', 'webidia_framework'), 'subtitle' => __('', 'webidia_framework'), 'default' => true, 'on' => 'Enabled', 'off' => 'Disabled'))));
Redux::setSection($opt_name, array('title' => __('Page Builder', 'webidia-builder'), 'desc' => '', 'subsection' => false, 'icon' => 'el el-icon-adjust-alt', 'fields' => array(array('id' => 'disable_spb', 'type' => 'button_set', 'title' => __('Webidia Page Builder', 'webidiaframework'), 'subtitle' => __('Enable/Disable the Webidia Page Builder functionality with this option.', 'webidiaframework'), 'desc' => '', 'options' => array('1' => 'Disabled', '0' => 'Enabled'), 'default' => '0'), array('id' => 'spb-post-types', 'type' => 'select', 'data' => 'post_types', 'multi' => true, 'default' => array('page', 'post', 'portfolio', 'team', 'spb-section'), 'title' => __('Page Builder Post Types', 'webidiaframework'), 'desc' => __('Select here which post types you would like to enable the page builder for.', 'webidiaframework')))));
Redux::setSection($opt_name, array('type' => 'divide', 'id' => 'divide-1'));
Redux::setSection($opt_name, array('title' => __('Webidia Slider', 'webidia-builder'), 'desc' => '', 'subsection' => false, 'icon' => 'el el-icon-website', 'fields' => array(array('id' => 'disable_ss', 'type' => 'button_set', 'title' => __('Webidia Slider', 'webidiaframework'), 'subtitle' => __('Enable/Disable the Webidia Slider functionality with this option.', 'webidiaframework'), 'desc' => '', 'options' => array('1' => 'Disabled', '0' => 'Enabled'), 'default' => '0'))));
Redux::setSection($opt_name, array('type' => 'divide', 'id' => 'divide-2'));
Redux::setSection($opt_name, array('title' => __('Custom Post Types', 'webidia-builder'), 'desc' => '', 'subsection' => false, 'icon' => 'el el-icon-view-mode', 'fields' => array(array('id' => 'cpt-disable', 'type' => 'checkbox', 'title' => __('Disable Custom Post Types', 'webidiaframework'), 'subtitle' => __('You can disable the custom post types used within the theme here, by checking the corresponding box. NOTE: If you do not want to disable any, then make sure none of the boxes are checked.', 'webidiaframework'), 'options' => array('portfolio' => 'Portfolio', 'galleries' => 'Galleries', 'team' => 'Team', 'clients' => 'Clients', 'testimonials' => 'Testimonials', 'directory' => 'Directory', 'faqs' => 'FAQ', 'spb-section' => 'SPB Section'), 'default' => array('portfolio' => '0', 'galleries' => '0', 'team' => '0', 'clients' => '0', 'testimonials' => '0', 'directory' => '0', 'webidia-slider' => '0')))));
Redux::setSection($opt_name, array('type' => 'divide', 'id' => 'divide-3'));
Redux::setSection($opt_name, array('title' => __('Performance', 'webidia-builder'), 'desc' => '', 'subsection' => false, 'icon' => 'el el-icon-fire', 'fields' => array(array('id' => 'enable_min_styles', 'type' => 'button_set', 'title' => __('Load pre-minified stylesheets', 'webidia-builder'), 'subtitle' => __('Enable this option to load pre-minified stlysheets, for faster page speed.', 'webidia-builder'), 'desc' => '', 'options' => array('1' => 'On', '0' => 'Off'), 'default' => '1'), array('id' => 'enable_min_scripts', 'type' => 'button_set', 'title' => __('Load pre-minified scripts', 'webidia-builder'), 'subtitle' => __('Enable this option to load pre-minified scripts, for faster page speed.', 'webidia-builder'), 'desc' => '', 'options' => array('1' => 'On', '0' => 'Off'), 'default' => '1'))));
}
示例3: array
/*
* ---> END ARGUMENTS
*/
/*
* ---> START HELP TABS
*/
$tabs = array(array('id' => 'redux-help-tab-1', 'title' => __('Theme Information 1', 'redux-framework-demo'), 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'redux-framework-demo')), array('id' => 'redux-help-tab-2', 'title' => __('Theme Information 2', 'redux-framework-demo'), 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'redux-framework-demo')));
Redux::setHelpTab($opt_name, $tabs);
// Set the help sidebar
$content = __('<p>This is the sidebar content, HTML is allowed.</p>', 'redux-framework-demo');
Redux::setHelpSidebar($opt_name, $content);
/*
* <--- END HELP TABS
*/
/*
*
* ---> START SECTIONS
*
*/
/*
As of Redux 3.5+, there is an extensive API. This API can be used in a mix/match mode allowing for
*/
// -> START Basic Fields
Redux::setSection($opt_name, array('title' => __('Basic Field', 'redux-framework-demo'), 'id' => 'basic', 'desc' => __('Basic field with no subsections.', 'redux-framework-demo'), 'icon' => 'el el-home', 'fields' => array(array('id' => 'opt-text', 'type' => 'text', 'title' => __('Example Text', 'redux-framework-demo'), 'desc' => __('Example description.', 'redux-framework-demo'), 'subtitle' => __('Example subtitle.', 'redux-framework-demo'), 'hint' => array('content' => 'This is a <b>hint</b> tool-tip for the text field.<br/><br/>Add any HTML based text you like here.')))));
Redux::setSection($opt_name, array('title' => __('Basic Fields', 'redux-framework-demo'), 'id' => 'basic', 'desc' => __('Basic fields as subsections.', 'redux-framework-demo'), 'icon' => 'el el-home'));
Redux::setSection($opt_name, array('title' => __('Text', 'redux-framework-demo'), 'desc' => __('For full documentation on this field, visit: ', 'redux-framework-demo') . '<a href="//docs.reduxframework.com/core/fields/text/" target="_blank">//docs.reduxframework.com/core/fields/text/</a>', 'id' => 'opt-text-subsection', 'subsection' => true, 'fields' => array(array('id' => 'text-example', 'type' => 'text', 'title' => __('Text Field', 'redux-framework-demo'), 'subtitle' => __('Subtitle', 'redux-framework-demo'), 'desc' => __('Field Description', 'redux-framework-demo'), 'default' => 'Default Text'))));
Redux::setSection($opt_name, array('title' => __('Text Area', 'redux-framework-demo'), 'desc' => __('For full documentation on this field, visit: ', 'redux-framework-demo') . '<a href="//docs.reduxframework.com/core/fields/textarea/" target="_blank">//docs.reduxframework.com/core/fields/textarea/</a>', 'id' => 'opt-textarea-subsection', 'subsection' => true, 'fields' => array(array('id' => 'textarea-example', 'type' => 'textarea', 'title' => __('Text Area Field', 'redux-framework-demo'), 'subtitle' => __('Subtitle', 'redux-framework-demo'), 'desc' => __('Field Description', 'redux-framework-demo'), 'default' => 'Default Text'))));
/*
* <--- END SECTIONS
*/
示例4: ultra_get_option
* ---> SET ARGUMENTS
* All the possible arguments for Redux.
* For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments
* */
/*ADDED in Ultra Admin - START */
// manageoptions and super admin
$ultraadmin_permissions = ultra_get_option("ultraadmin_plugin_access", "manage_options");
if ($ultraadmin_permissions == "super_admin" && is_super_admin()) {
$ultraadmin_permissions = 'manage_options';
}
// specific user
$ultraadmin_userid = ultra_get_option("ultraadmin_plugin_userid", "");
if ($ultraadmin_permissions == "specific_user" && $ultraadmin_userid == get_current_user_id()) {
$ultraadmin_permissions = 'read';
}
// if plugin is network activated, then hide it from inner sites.
$menu_type = 'menu';
if (!function_exists('is_plugin_active_for_network')) {
require_once ABSPATH . '/wp-admin/includes/plugin.php';
}
// Makes sure the plugin is defined before trying to use it
if (is_plugin_active_for_network('ultra-admin/ultra-core.php')) {
if (!is_main_site()) {
$menu_type = 'hidden';
}
}
/*ADDED in Ultra Admin - END*/
// $theme = wp_get_theme(); // For use with some settings. Not necessary.
$args = array('opt_name' => $manager_option, 'display_name' => 'Quản lý thiết bị phòng thực hành', 'display_version' => '1.0', 'menu_type' => $menu_type, 'allow_sub_menu' => true, 'menu_title' => __('Management', 'redux-framework-ultra-demo'), 'page_title' => __('Management', 'redux-framework-ultra-demo'), 'google_api_key' => '', 'google_update_weekly' => false, 'async_typography' => true, 'admin_bar' => true, 'admin_bar_icon' => 'dashicons-portfolio', 'admin_bar_priority' => 50, 'global_variable' => 'manager_option', 'dev_mode' => false, 'update_notice' => true, 'customizer' => false, 'page_priority' => null, 'page_parent' => 'themes.php', 'page_permissions' => $ultraadmin_permissions, 'menu_icon' => '', 'last_tab' => '', 'page_icon' => 'icon-themes', 'page_slug' => 'manager_control', 'save_defaults' => true, 'default_show' => false, 'default_mark' => '', 'show_import_export' => true, 'transient_time' => 60 * MINUTE_IN_SECONDS, 'output' => true, 'output_tag' => true, 'footer_credit' => ' ', 'database' => '', 'system_info' => false, 'hints' => array('icon' => 'el el-question-sign', 'icon_position' => 'right', 'icon_color' => 'lightgray', 'icon_size' => 'normal', 'tip_style' => array('color' => 'light', 'shadow' => true, 'rounded' => false, 'style' => ''), 'tip_position' => array('my' => 'top left', 'at' => 'bottom right'), 'tip_effect' => array('show' => array('effect' => 'slide', 'duration' => '500', 'event' => 'mouseover'), 'hide' => array('effect' => 'slide', 'duration' => '500', 'event' => 'click mouseleave'))));
Redux::setArgs($manager_option, $args);
示例5: vortex_systen_main_function
function vortex_systen_main_function()
{
if (!function_exists('is_plugin_active')) {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if (class_exists('myCRED_Hook')) {
include plugin_dir_path(__FILE__) . 'mycredcomments.php';
include plugin_dir_path(__FILE__) . 'mycredposts.php';
function vortex_mycred_references_filter($references)
{
$references['vortex_like_posts_mycred_author_content'] = __('Receive like for posts(content author)', 'vortex_system_ld');
$references['vortex_like_posts_mycred_author'] = __('Receive like for posts(like author)', 'vortex_system_ld');
$references['vortex_like_coms_mycred_author_content'] = __('Receive like for comments(content author)', 'vortex_system_ld');
$references['vortex_like_coms_mycred_author'] = __('Receive like for comments(like author)', 'vortex_system_ld');
return $references;
}
add_filter('mycred_all_references', 'vortex_mycred_references_filter');
}
if (function_exists('is_plugin_active')) {
if (is_plugin_active('redux-framework/redux-framework.php')) {
load_plugin_textdomain('vortex_system_ld', FALSE, basename(plugin_dir_path(__FILE__)) . '/languages');
$reduxoption = plugin_dir_path(__FILE__) . 'admin/vortexlikedislike.php';
$reduxframework = plugin_dir_path(plugin_dir_path(__FILE__)) . 'redux-framework/ReduxCore/framework.php';
if (!class_exists('ReduxFramework') && file_exists($reduxframework)) {
include $reduxframework;
}
if (!isset($vortex_like_dislike) && file_exists($reduxoption)) {
include $reduxoption;
}
//donation button
function vortex_system_donation_button()
{
echo '<form style="width:260px;margin:0 auto;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="VVGFFVJSFVZ7S">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
';
}
add_action('redux/vortex_like_dislike/panel/before', 'vortex_system_donation_button');
add_action('redux/vortex_like_dislike/panel/after', 'vortex_system_donation_button');
Redux::init('vortex_like_dislike');
global $vortex_like_dislike;
if ($vortex_like_dislike['v-switch-posts'] && isset($vortex_like_dislike['v-switch-posts'])) {
include plugin_dir_path(__FILE__) . 'posts-pages.php';
//load metabox
include plugin_dir_path(__FILE__) . 'metabox.php';
}
if ($vortex_like_dislike['v-switch-comments'] && isset($vortex_like_dislike['v-switch-comments'])) {
include plugin_dir_path(__FILE__) . 'comments.php';
}
//add custom fields when comment is submited
add_action('comment_post', 'vortex_system_add_likes_dislikes_comments');
function vortex_system_add_likes_dislikes_comments($comment_ID)
{
global $vortex_like_dislike;
$likes = 0;
$dislikes = 0;
if (isset($vortex_like_dislike['v_start_comment_like'])) {
$likes = $vortex_like_dislike['v_start_comment_like'];
}
if (isset($vortex_like_dislike['v_start_comment_dislike'])) {
$dislikes = $vortex_like_dislike['v_start_comment_dislike'];
}
add_comment_meta($comment_ID, 'vortex_system_likes', $likes, true);
add_comment_meta($comment_ID, 'vortex_system_dislikes', $dislikes, true);
}
//add custom fields when post is published
add_action('publish_post', 'post_published_notification');
function post_published_notification($ID)
{
global $vortex_like_dislike;
$likes = 0;
$dislikes = 0;
if (isset($vortex_like_dislike['v_start_post_like'])) {
$likes = $vortex_like_dislike['v_start_post_like'];
}
if (isset($vortex_like_dislike['v_start_post_dislike'])) {
$dislikes = $vortex_like_dislike['v_start_post_dislike'];
}
add_post_meta($ID, 'vortex_system_likes', $likes, true);
add_post_meta($ID, 'vortex_system_dislikes', $dislikes, true);
}
}
}
}
示例6: array
<?php
// -> START Basic Fields
Redux::setSection($opt_name, array('title' => __('Pages', 'span'), 'id' => 'pages_options', 'desc' => __('General Options for Pages', 'span'), 'customizer_width' => '400px', 'icon' => 'el el-file'));
global $option_namespace;
$option_namespace = 'pages';
require get_template_directory() . '/admin/parts/_global-options.php';
示例7: array
<td>activate ShopStyler customizer</td>
</tr>
<tr>
<td>Set Shop as homepage</td>
<td>When enabled will set WordPress homepage to the shop page</td>
</tr>
<tr>
<td>Set Shop as homepage</td>
<td>When enabled will set WordPress homepage to the shop page</td>
</tr>
</table>
', 'shopstyler-plugin')), array('id' => 'redux-help-tab-2', 'title' => __('Shop Page', 'shopstyler-plugin'), 'content' => __('<p>Shop Page settings</p>', 'shopstyler-plugin')), array('id' => 'redux-help-tab-3', 'title' => __('Product Page', 'shopstyler-plugin'), 'content' => __('<p>Product Page settings</p>', 'shopstyler-plugin')), array('id' => 'redux-help-tab-4', 'title' => __('Sidebar', 'shopstyler-plugin'), 'content' => __('<p>Sidebar settings</p>', 'shopstyler-plugin')));
Redux::setHelpTab($opt_name, $tabs);
// Set the help sidebar
$content = __('<p>ShopStyler Documentation</p><a href="http://shopstyler.moodgiver.com/docs"><button>Read</button></a>', 'shopstyler-plugin');
Redux::setHelpSidebar($opt_name, $content);
/*
* <--- END HELP TABS
*/
//load custom palettes
/*
*
* ---> START SECTIONS
*
*/
/*
As of Redux 3.5+, there is an extensive API. This API can be used in a mix/match mode allowing for
*/
/*************************** START SETTINGS
示例8: array
<?php
/*
* Header Options
*/
global $opt_name;
Redux::setSection($opt_name, array('title' => __('Header', 'inspiry'), 'id' => 'header-section', 'desc' => __('This section contains options for header.', 'inspiry'), 'fields' => array(array('id' => 'inspiry_header_variation', 'type' => 'image_select', 'title' => __('Header Design Variation', 'inspiry'), 'subtitle' => __('Select the design variation that you want to use for site header.', 'inspiry'), 'options' => array('1' => array('title' => __('1st Variation', 'inspiry'), 'img' => get_template_directory_uri() . '/inc/theme-options/images/header-variation-1.png'), '2' => array('title' => __('2nd Variation', 'inspiry'), 'img' => get_template_directory_uri() . '/inc/theme-options/images/header-variation-2.png')), 'default' => '1'), array('id' => 'inspiry_header_menu_title', 'type' => 'text', 'title' => __('Menu Button Title', 'inspiry'), 'default' => __('Menu', 'inspiry'), 'required' => array('inspiry_header_variation', '=', 1)), array('id' => 'inspiry_favicon', 'type' => 'media', 'url' => false, 'title' => __('Favicon', 'inspiry'), 'subtitle' => __('Upload your website favicon.', 'inspiry')), array('id' => 'inspiry_logo', 'type' => 'media', 'url' => false, 'title' => __('Logo', 'inspiry'), 'subtitle' => __('Upload logo image for your Website. Otherwise site title will be displayed in place of logo.', 'inspiry')), array('id' => 'inspiry_header_phone', 'type' => 'text', 'title' => __('Phone Number', 'inspiry'), 'default' => ''), array('id' => 'inspiry_facebook_url', 'type' => 'text', 'title' => __('Facebook URL', 'inspiry'), 'validate' => 'url', 'default' => ''), array('id' => 'inspiry_twitter_url', 'type' => 'text', 'title' => __('Twitter URL', 'inspiry'), 'validate' => 'url', 'default' => ''), array('id' => 'inspiry_google_url', 'type' => 'text', 'title' => __('Google Plus URL', 'inspiry'), 'validate' => 'url', 'default' => ''), array('id' => 'inspiry_banner_image', 'type' => 'media', 'url' => false, 'title' => __('Banner Image', 'inspiry'), 'desc' => __('Banner image should have minimum width of 2000px and minimum height of 320px.', 'inspiry'), 'subtitle' => __('This banner image will be displayed on all the pages where banner image is not overridden by page specific banner settings.', 'inspiry')), array('id' => 'inspiry_display_wpml_flags', 'type' => 'switch', 'title' => __('WPML Language Switcher Flags', 'inspiry'), 'subtitle' => __('Do you want to display WPML language switcher flags in header top bar ?', 'inspiry'), 'desc' => __('This option only works if WPML plugin is installed.', 'inspiry'), 'default' => 1, 'on' => __('Display', 'inspiry'), 'off' => __('Hide', 'inspiry')), array('id' => 'inspiry_page_loader', 'type' => 'switch', 'title' => __('Page Loader', 'inspiry'), 'desc' => __('You can enable or disable page loader.', 'inspiry'), 'default' => 1, 'on' => __('Enable', 'inspiry'), 'off' => __('Disable', 'inspiry')), array('id' => 'inspiry_page_loader_gif', 'type' => 'media', 'url' => false, 'title' => __('Page Loader Gif', 'inspiry'), 'desc' => __('You can upload your page loader gif here or default one will be displayed.', 'inspiry'), 'required' => array('inspiry_page_loader', '=', 1)), array('id' => 'inspiry_quick_js', 'type' => 'ace_editor', 'title' => __('Quick JavaScript', 'inspiry'), 'desc' => __('You can paste your JavaScript code here.', 'inspiry'), 'mode' => 'javascript', 'theme' => 'chrome'))));
示例9: getExtensions
}
}
}
public static function getExtensions($key = "", $opt_name = "")
{
if (empty($opt_name)) {
if (empty($key)) {
return self::$extension_paths[$key];
} else {
if (isset(self::$extension_paths[$key])) {
return self::$extension_paths[$key];
}
}
} else {
if (empty(self::$uses_extensions[$opt_name])) {
return false;
}
$instanceExtensions = array();
foreach (self::$uses_extensions[$opt_name] as $extension) {
$class_file = end(self::$extensions[$extension]);
$name = str_replace('.php', '', basename($extension));
$extension_class = 'ReduxFramework_Extension_' . $name;
$instanceExtensions[$extension] = array('path' => $class_file, 'class' => $extension_class);
}
return $instanceExtensions;
}
return false;
}
}
Redux::load();
}
示例10: init
public function init()
{
Redux::setArgs($this->opt_name, $this->args);
$sections = $this->addSections();
Redux::setSections($this->opt_name, $sections);
}
示例11: array
/*
*
* ---> START SECTIONS
*
*/
/*
As of Redux 3.5+, there is an extensive API. This API can be used in a mix/match mode allowing for
*/
// -> Opções gerais
Redux::setSection($opt_name, array('title' => __('Opções gerais', 'redux-framework-demo'), 'id' => 'basic', 'desc' => __('', 'redux-framework-demo'), 'icon' => 'el el-home', 'fields' => array(array('id' => 'fanpage-url', 'type' => 'text', 'title' => __('Endereço da Fanpage', 'redux-framework-demo'), 'validate' => 'url', 'default' => 'http://facebook.com'), array('id' => 'twitter-url', 'type' => 'text', 'title' => __('Twitter', 'redux-framework-demo'), 'validate' => 'url', 'default' => 'http://twitter.com'), array('id' => 'instagram-url', 'type' => 'text', 'title' => __('Instagram', 'redux-framework-demo'), 'validate' => 'url', 'default' => 'http://instagram.com'), array('id' => 'youtube-url', 'type' => 'text', 'title' => __('Youtube', 'redux-framework-demo'), 'validate' => 'url', 'default' => 'http://youtube.com'), array('id' => 'pinterest-url', 'type' => 'text', 'title' => __('Pinterest', 'redux-framework-demo'), 'validate' => 'url', 'default' => 'http://pinterest.com'), array('id' => 'sergio-email', 'type' => 'text', 'title' => __('Endereço da Fanpage', 'redux-framework-demo'), 'validate' => 'email', 'default' => 'sergio.dostum@hotmail.com'), array('id' => 'sergio-tels', 'type' => 'multi_text', 'title' => __('Adicione os números telefônicos', 'redux-framework-demo'), 'subtitle' => __('', 'redux-framework-demo'), 'desc' => __('Ex.: TIM +55 9342 9238', 'redux-framework-demo')), array('id' => 'sergio-local', 'type' => 'text', 'title' => __('Dados de localização', 'redux-framework-demo'), 'default' => 'R. Dom Pedro II, 941 - Prata, Campina Grande - PB, 58400-062'))));
// -> Painel
Redux::setSection($opt_name, array('title' => __('Painel', 'redux-framework-demo'), 'id' => 'panel', 'desc' => __('', 'redux-framework-demo'), 'icon' => 'el el-photo', 'fields' => array(array('id' => 'slides-panel', 'type' => 'slides', 'title' => __('Adicionar sliders', 'redux-framework-demo'), 'subtitle' => __('Todas as imagens serão usadas no slider', 'redux-framework-demo'), 'desc' => __('', 'redux-framework-demo'), 'placeholder' => array('title' => __('Título', 'redux-framework-demo'), 'description' => __('Descrição', 'redux-framework-demo'), 'url' => __('Link', 'redux-framework-demo'))))));
// -> Prêmios recebidos
Redux::setSection($opt_name, array('title' => __('Prêmios recebidos', 'redux-framework-demo'), 'id' => 'winners', 'desc' => __('', 'redux-framework-demo'), 'icon' => 'el el-star-empty', 'fields' => array(array('id' => 'slides-winners', 'type' => 'slides', 'title' => __('Adicionar prêmios', 'redux-framework-demo'), 'subtitle' => __('', 'redux-framework-demo'), 'desc' => __('', 'redux-framework-demo'), 'placeholder' => array('title' => __('Título', 'redux-framework-demo'), 'description' => __('Descrição', 'redux-framework-demo'), 'url' => __('Link', 'redux-framework-demo'))))));
// -> Painel
Redux::setSection($opt_name, array('title' => __('Newsletter', 'redux-framework-demo'), 'id' => 'newsletter', 'desc' => __('', 'redux-framework-demo'), 'icon' => 'el el-envelope', 'fields' => array(array('id' => 'newsletter-header', 'type' => 'text', 'title' => __('Cabeçalho', 'redux-framework-demo'), 'default' => 'INSCREVA-SE EM NOSSA LISTA DE CARTINHAS'), array('id' => 'newsletter-desc', 'type' => 'textarea', 'title' => __('Descrição', 'redux-framework-demo'), 'default' => 'Estamos sempre produzindo textos reflexivos e compartilhando nossas ideias sobre como o design pode mudar o mundo. Enviamos a cada duas semanas uma cartinha para os nossos seguidores, cheia de referências e conteúdos interessantes, além de ofertas exclusivas para os nossos produtos.'), array('id' => 'newsletter-btn', 'type' => 'text', 'title' => __('Texto do botão', 'redux-framework-demo'), 'default' => 'Quero receber'))));
/**Redux::setSection( $opt_name, array(
'title' => __( 'Text', 'redux-framework-demo' ),
'desc' => __( 'For full documentation on this field, visit: ', 'redux-framework-demo' ) . '<a href="//docs.reduxframework.com/core/fields/text/" target="_blank">//docs.reduxframework.com/core/fields/text/</a>',
'id' => 'opt-text-subsection',
'subsection' => true,
'fields' => array(
array(
'id' => 'text-example',
'type' => 'text',
'title' => __( 'Text Field', 'redux-framework-demo' ),
'subtitle' => __( 'Subtitle', 'redux-framework-demo' ),
'desc' => __( 'Field Description', 'redux-framework-demo' ),
'default' => 'Default Text',
),
)
示例12: array
/**
Colors
*/
Redux::setSection($vw_opt_name, array('title' => 'Colors', 'desc' => 'These are options for theme colors and background.', 'id' => 'vw-options-colors', 'icon' => 'el el-tint', 'fields' => array(array('id' => 'color_primary', 'type' => 'color', 'title' => 'Primary Color', 'subtitle' => 'Font color for links, buttons, hilight area, etc.', 'transparent' => false, 'default' => '#3facd6'))));
Redux::setSection($vw_opt_name, array('title' => 'Top Bar Colors', 'desc' => '', 'id' => 'vw-options-colors-top-bar', 'subsection' => true, 'fields' => array(array('id' => 'color_topbar_bg', 'type' => 'color', 'title' => 'Background Color', 'mode' => 'background', 'transparent' => false, 'default' => '#333333'), array('id' => 'color_topbar_font', 'type' => 'color', 'title' => 'Font Color', 'transparent' => false, 'default' => '#eeeeee'), array('id' => 'color_topbar_highlight', 'type' => 'color', 'title' => 'Hightlight Color', 'subtitle' => 'Hightlight color for link and button hover, etc.', 'transparent' => false, 'default' => '#3facd6'), array('id' => 'color_topbar_highlight_font', 'type' => 'color', 'title' => 'Hightlight Font Color', 'subtitle' => 'Hightlight font color for link and button hover, etc.', 'transparent' => false, 'default' => '#ffffff'))));
Redux::setSection($vw_opt_name, array('title' => 'Header Colors', 'desc' => '', 'id' => 'vw-options-colors-header', 'subsection' => true, 'fields' => array(array('id' => 'color_header_bg', 'type' => 'color', 'title' => 'Background Color', 'mode' => 'background', 'transparent' => false, 'default' => '#f9f9f9'), array('id' => 'color_header_font', 'type' => 'color', 'title' => 'Font Color', 'transparent' => false, 'default' => '#bbbbbb'))));
Redux::setSection($vw_opt_name, array('title' => 'Main Menu Colors', 'desc' => '', 'id' => 'vw-options-colors-main-menu', 'subsection' => true, 'fields' => array(array('id' => 'color_nav_bg', 'type' => 'color', 'title' => 'Background Color', 'mode' => 'background', 'transparent' => false, 'default' => '#333333'), array('id' => 'color_nav_font', 'type' => 'color', 'title' => 'Font Color', 'transparent' => false, 'default' => '#ffffff'), array('id' => 'color_nav_highlight', 'type' => 'color', 'title' => 'Hightlight Color', 'subtitle' => 'Hightlight color for link and button hover, etc.', 'transparent' => false, 'default' => '#3facd6'), array('id' => 'color_nav_highlight_font', 'type' => 'color', 'title' => 'Hightlight Font Color', 'subtitle' => 'Hightlight font color for link and button hover, etc.', 'transparent' => false, 'default' => '#ffffff'))));
Redux::setSection($vw_opt_name, array('title' => 'Footer Colors', 'desc' => '', 'id' => 'vw-options-colors-footer', 'subsection' => true, 'fields' => array(array('id' => 'color_footer_bg', 'type' => 'color', 'title' => 'Background Color', 'mode' => 'background', 'transparent' => false, 'default' => '#111111'), array('id' => 'color_footer_font', 'type' => 'color', 'title' => 'Font Color', 'transparent' => false, 'default' => '#999999'), array('id' => 'color_footer_heading', 'type' => 'color', 'title' => 'Heading Font Color', 'transparent' => false, 'default' => '#222222'))));
Redux::setSection($vw_opt_name, array('title' => 'Copyright Bar Colors', 'desc' => '', 'id' => 'vw-options-colors-copyright-bar', 'subsection' => true, 'fields' => array(array('id' => 'color_copyright_bg', 'type' => 'color', 'title' => 'Background Color', 'mode' => 'background', 'transparent' => false, 'default' => '#000000'), array('id' => 'color_copyright_font', 'type' => 'color', 'title' => 'Font Color', 'transparent' => false, 'default' => '#dddddd'))));
/**
bbPress
*/
Redux::setSection($vw_opt_name, array('title' => 'bbPress', 'desc' => 'These are options for bbPress. You need to install the <a href="https://wordpress.org/plugins/bbpress/" target="_blank">bbPress plugin</a> before using these options.', 'id' => 'vw-options-bbpress', 'icon' => 'el el-group-alt', 'fields' => array(array('id' => 'bbpress_enable_sidebar', 'type' => 'switch', 'title' => 'Enable Sidebar', 'default' => 0), array('id' => 'bbpress_sidebar', 'type' => 'select', 'title' => 'Default Sidebar for bbPress', 'data' => 'sidebar', 'default' => 'blog-sidebar'))));
/**
Custom CSS
*/
Redux::setSection($vw_opt_name, array('title' => 'Custom CSS/JS', 'desc' => '', 'id' => 'vw-options-custom-css', 'icon' => 'el el-certificate', 'fields' => array(array('id' => 'custom_css', 'type' => 'ace_editor', 'theme' => 'monokai', 'mode' => 'css', 'title' => 'Custom CSS', 'subtitle' => 'Paste your CSS code here.'), array('id' => 'custom_js', 'type' => 'ace_editor', 'theme' => 'monokai', 'mode' => 'javascript', 'title' => 'Custom JS', 'subtitle' => 'Paste your JS code here.'))));
do_action('vw_action_init_theme_options', $vw_opt_name);
/* -----------------------------------------------------------------------------
* Actions
* -------------------------------------------------------------------------- */
add_action('redux/options/' . $vw_opt_name . '/saved', 'vw_options_saved');
if (!function_exists('vw_options_saved')) {
function vw_options_saved()
{
if (function_exists('icl_register_string')) {
$copyright_text = vw_get_option('copyright_text');
icl_register_string(VW_THEME_NAME . ' Copyright', strtolower(VW_THEME_NAME . '_copyright'), $copyright_text);
}
}
}
示例13: __
// Add content after the form.
$args['footer_text'] = __('', 'redux-framework-demo');
Redux::setArgs($opt_name, $args);
/*
* ---> END ARGUMENTS
*/
/*
* ---> START HELP TABS
*/
$tabs = array(array('id' => 'redux-help-tab-1', 'title' => __('Theme Information 1', 'redux-framework-demo'), 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'redux-framework-demo')), array('id' => 'redux-help-tab-2', 'title' => __('Theme Information 2', 'redux-framework-demo'), 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'redux-framework-demo')));
Redux::setHelpTab($opt_name, $tabs);
// Set the help sidebar
$content = __('<p>This is the sidebar content, HTML is allowed.</p>', 'redux-framework-demo');
Redux::setHelpSidebar($opt_name, $content);
// -> START Typography
Redux::setSection($opt_name, array('title' => __('General', 'redux-framework-demo'), 'id' => 'typography', 'icon' => 'el el-wrench', 'fields' => array(array('id' => 'text-example', 'type' => 'text', 'title' => __('Text Field', 'redux-framework-demo'), 'subtitle' => __('Subtitle', 'redux-framework-demo'), 'desc' => __('Field Description', 'redux-framework-demo'), 'default' => 'Default Text'))));
/*
* <--- END SECTIONS
*/
/**
* This is a test function that will let you see when the compiler hook occurs.
* It only runs if a field set with compiler=>true is changed.
* */
function compiler_action($options, $css, $changed_values)
{
echo '<h1>The compiler hook has run!</h1>';
echo "<pre>";
print_r($changed_values);
// Values that have changed since the last save
echo "</pre>";
//print_r($options); //Option values
示例14: dirname
<?php
// All extensions placed within the extensions directory will be auto-loaded for your Redux instance.
Redux::setExtensions('redux_builder_panvagenas', dirname(__FILE__) . '/extensions/');
// Any custom extension configs should be placed within the configs folder.
if (file_exists(dirname(__FILE__) . '/configs/')) {
$files = glob(dirname(__FILE__) . '/configs/*.php');
if (!empty($files)) {
foreach ($files as $file) {
include $file;
}
}
}
示例15: dirname
<?php
if (class_exists('Redux')) {
$opt_name = 'pinnacle';
Redux::setExtensions($opt_name, dirname(__FILE__) . '/extensions/');
}