initSettings();
} else {
add_action( 'plugins_loaded', array( $this, 'initSettings' ), 10 );
}
}
public function initSettings() {
// Just for demo purposes. Not needed per say.
$this->theme = wp_get_theme();
// Set the default arguments
$this->setArguments();
// Create the sections and fields
$this->setSections();
if ( ! isset( $this->args['opt_name'] ) ) { // No errors please
return;
}
// If Redux is running as a plugin, this will remove the demo notice and links
//add_action( 'redux/loaded', array( $this, 'remove_demo' ) );
// Function to test the compiler hook and demo CSS output.
// Above 10 is a priority, but 2 in necessary to include the dynamically generated CSS to be sent to the function.
//add_filter('redux/options/'.$this->args['opt_name'].'/compiler', array( $this, 'compiler_action' ), 10, 3);
// Change the arguments after they've been declared, but before the panel is created
//add_filter('redux/options/'.$this->args['opt_name'].'/args', array( $this, 'change_arguments' ) );
// Change the default value of a field after it's been set, but before it's been useds
//add_filter('redux/options/'.$this->args['opt_name'].'/defaults', array( $this,'change_defaults' ) );
// Dynamically add a section. Can be also used to modify sections/fields
//add_filter('redux/options/' . $this->args['opt_name'] . '/sections', array($this, 'dynamic_section'));
$this->ReduxFramework = new ReduxFramework( $this->sections, $this->args );
}
/**
* 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 '
The compiler hook has run!
';
echo "";
print_r( $changed_values ); // Values that have changed since the last save
echo "";
//print_r($options); //Option values
//print_r($css); // Compiler selector CSS values compiler => array( CSS SELECTORS )
/*
// Demo of how to use the dynamic CSS and write your own static CSS file
$filename = dirname(__FILE__) . '/style' . '.css';
global $wp_filesystem;
if( empty( $wp_filesystem ) ) {
require_once( ABSPATH .'/wp-admin/includes/file.php' );
WP_Filesystem();
}
if( $wp_filesystem ) {
$wp_filesystem->put_contents(
$filename,
$css,
FS_CHMOD_FILE // predefined mode settings for WP files
);
}
*/
}
/**
* Custom function for filtering the sections array. Good for child themes to override or add to the sections.
* Simply include this function in the child themes functions.php file.
* NOTE: the defined constants for URLs, and directories will NOT be available at this point in a child theme,
* so you must use get_template_directory_uri() if you want to use any of the built in icons
* */
function dynamic_section( $sections ) {
//$sections = array();
$sections[] = array(
'title' => __( 'Section via hook', 'bloger-admin-option' ),
'desc' => __( 'This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.
', 'bloger-admin-option' ),
'icon' => 'el-icon-paper-clip',
// Leave this as a blank section, no options just some intro text set above.
'fields' => array()
);
return $sections;
}
/**
* Filter hook for filtering the args. Good for child themes to override or add to the args array. Can also be used in other functions.
* */
function change_arguments( $args ) {
//$args['dev_mode'] = true;
return $args;
}
/**
* Filter hook for filtering the default value of any given field. Very useful in development mode.
* */
function change_defaults( $defaults ) {
$defaults['str_replace'] = 'Testing filter hook!';
return $defaults;
}
// Remove the demo link and the notice of integrated demo from the bloger-admin plugin
function remove_demo() {
// Used to hide the demo mode link from the plugin page. Only used when Redux is a plugin.
if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
remove_filter( 'plugin_row_meta', array(
ReduxFrameworkPlugin::instance(),
'plugin_metalinks'
), null, 2 );
// Used to hide the activation notice informing users of the demo panel. Only used when Redux is a plugin.
remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) );
}
}
public function setSections() {
/**
* Used within different fields. Simply examples. Search for ACTUAL DECLARATION for field examples
* */
// Background Patterns Reader
$sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/';
$sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/';
$sample_patterns = array();
if ( is_dir( $sample_patterns_path ) ) :
if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) :
$sample_patterns = array();
while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {
if ( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {
$name = explode( '.', $sample_patterns_file );
$name = str_replace( '.' . end( $name ), '', $sample_patterns_file );
$sample_patterns[] = array(
'alt' => $name,
'img' => $sample_patterns_url . $sample_patterns_file
);
}
}
endif;
endif;
ob_start();
$ct = wp_get_theme();
$this->theme = $ct;
$item_name = $this->theme->get( 'Name' );
$tags = $this->theme->Tags;
$screenshot = $this->theme->get_screenshot();
$class = $screenshot ? 'has-screenshot' : '';
$customize_title = sprintf( __( 'Customize “%s”', 'bloger-admin-option' ), $this->theme->display( 'Name' ) );
?>
theme->display( 'Name' ); ?>
- theme->display( 'Author' ) ); ?>
- theme->display( 'Version' ) ); ?>
- ' . __( 'Tags', 'bloger-admin-option' ) . ': '; ?>theme->display( 'Tags' ) ); ?>
theme->display( 'Description' ); ?>
theme->parent() ) {
printf( '
' . __( 'This child theme requires its parent theme, %2$s.', 'bloger-admin-option' ) . '
', __( 'http://codex.wordpress.org/Child_Themes', 'bloger-admin-option' ), $this->theme->parent()->display( 'Name' ) );
}
?>
get_contents( dirname( __FILE__ ) . '/info-html.html' );
}
$this->sections[] = array(
'icon' => 'el-icon-cogs',
'title' => __( 'General Settings', 'bloger-admin-option' ),
'fields' => array(
array(
'id' => 'opt-logo',
'type' => 'media',
'url' => true,
'title' => __( 'Upload Logo', 'bloger-admin-option' ),
'compiler' => 'true',
//'mode' => false, // Can be set to false to allow any media type, or can also be set to any mime type.
'desc' => __( 'Size logo must 260x54.', 'bloger-admin-option' ),
'subtitle' => __( 'Upload image for logo', 'bloger-admin-option' ),
'default' => array( 'url' => '' ),
//'hint' => array(
// 'title' => 'Hint Title',
// 'content' => 'This is a hint for the media field with a Title.',
//)
),
array(
'id'=>'opt-favicon',
'type' => 'media',
'title' => __('FavIcon', 'bloger-admin-options'),
'compiler' => 'true',
'mode' => false, // Can be set to false to allow any media type, or can also be set to any mime type.
'desc' => __('Upload your own favicon .', 'bloger-admin-options')
),
array(
'id'=>'opt-trackingcode',
'type' => 'textarea',
'title' => __('Tracking Code', 'bloger-admin-demo'),
'mode' => false, // Can be set to false to allow any media type, or can also be set to any mime type.
'desc' => __('Add you tracking / analytics code here ', 'bloger-admin-demo')
),
array(
'id'=>'opt-footercopy',
'type' => 'textarea',
'title' => __('Copyrights', 'bloger-admin-demo'),
'desc' => __('Add you copyrights , this will be printed in footer section.', 'bloger-admin-demo'),
'default' => ' © 2015 Code is Poetry | Powered by @pixelcute'
),
array(
'id'=>'opt-enable_basic_seo',
'type' => 'switch',
'title' => __('Enable Basic SEO Settings', 'bloger-admin-demo'),
'desc'=> __('You can enable or disable basic seo settings , set this option to "Disabled" if you use any advanced SEO plugin like Yoast .', 'bloger-admin-demo'),
'default' => 1,
'on' => 'Enabled',
'off' => 'Disabled'
),
/*
array(
'id' => 'opt-textarea',
'type' => 'textarea',
'required' => array( 'layout', 'equals', '1' ),
'title' => __( 'Tracking Code', 'bloger-admin-option' ),
'subtitle' => __( 'Paste your Google Analytics (or other) tracking code here. This will be added into the footer template of your theme.', 'bloger-admin-option' ),
'validate' => 'js',
'desc' => 'Validate that it\'s javascript!',
),
array(
'id' => 'opt-ace-editor-css',
'type' => 'ace_editor',
'title' => __( 'CSS Code', 'bloger-admin-option' ),
'subtitle' => __( 'Paste your CSS code here.', 'bloger-admin-option' ),
'mode' => 'css',
'theme' => 'monokai',
'desc' => 'Possible modes can be found at http://ace.c9.io/.',
'default' => "#header{\nmargin: 0 auto;\n}"
),
array(
'id' => 'opt-ace-editor-js',
'type' => 'ace_editor',
'title' => __('JS Code', 'bloger-admin-option'),
'subtitle' => __('Paste your JS code here.', 'bloger-admin-option'),
'mode' => 'javascript',
'theme' => 'chrome',
'desc' => 'Possible modes can be found at http://ace.c9.io/.',
'default' => "jQuery(document).ready(function(){\n\n});"
),
array(
'id' => 'opt-ace-editor-php',
'type' => 'ace_editor',
'title' => __('PHP Code', 'bloger-admin-option'),
'subtitle' => __('Paste your PHP code here.', 'bloger-admin-option'),
'mode' => 'php',
'theme' => 'chrome',
'desc' => 'Possible modes can be found at http://ace.c9.io/.',
'default' => ''
),
*/
),
);
/*
$this->sections[] = array(
'icon' => 'el-icon-website',
'title' => __( 'Styling Options', 'bloger-admin-option' ),
'subsection' => true,
'fields' => array(
array(
'id' => 'opt-select-stylesheet',
'type' => 'select',
'title' => __( 'Theme Stylesheet', 'bloger-admin-option' ),
'subtitle' => __( 'Select your themes alternative color scheme.', 'bloger-admin-option' ),
'options' => array( 'default.css' => 'default.css', 'color1.css' => 'color1.css' ),
'default' => 'default.css',
),
array(
'id' => 'opt-color-background',
'type' => 'color',
'output' => array( '.site-title' ),
'title' => __( 'Body Background Color', 'bloger-admin-option' ),
'subtitle' => __( 'Pick a background color for the theme (default: #fff).', 'bloger-admin-option' ),
'default' => '#FFFFFF',
'validate' => 'color',
),
array(
'id' => 'opt-background',
'type' => 'background',
'output' => array( 'body' ),
'title' => __( 'Body Background', 'bloger-admin-option' ),
'subtitle' => __( 'Body background with image, color, etc.', 'bloger-admin-option' ),
//'default' => '#FFFFFF',
),
array(
'id' => 'opt-color-footer',
'type' => 'color',
'title' => __( 'Footer Background Color', 'bloger-admin-option' ),
'subtitle' => __( 'Pick a background color for the footer (default: #dd9933).', 'bloger-admin-option' ),
'default' => '#dd9933',
'validate' => 'color',
),
array(
'id' => 'opt-color-rgba',
'type' => 'color_rgba',
'title' => __( 'Color RGBA', 'bloger-admin-option' ),
'subtitle' => __( 'Gives you the RGBA color.', 'bloger-admin-option' ),
'default' => array(
'color' => '#fff',
'alpha' => '.8'
),
'output' => array( 'body' ),
'mode' => 'background',
'validate' => 'colorrgba',
),
array(
'id' => 'opt-color-header',
'type' => 'color_gradient',
'title' => __( 'Header Gradient Color Option', 'bloger-admin-option' ),
'subtitle' => __( 'Only color validation can be done on this field type', 'bloger-admin-option' ),
'desc' => __( 'This is the description field, again good for additional info.', 'bloger-admin-option' ),
'default' => array(
'from' => '#1e73be',
'to' => '#00897e'
)
),
array(
'id' => 'opt-link-color',
'type' => 'link_color',
'title' => __( 'Links Color Option', 'bloger-admin-option' ),
'subtitle' => __( 'Only color validation can be done on this field type', 'bloger-admin-option' ),
'desc' => __( 'This is the description field, again good for additional info.', 'bloger-admin-option' ),
//'regular' => false, // Disable Regular Color
//'hover' => false, // Disable Hover Color
//'active' => false, // Disable Active Color
//'visited' => true, // Enable Visited Color
'default' => array(
'regular' => '#aaa',
'hover' => '#bbb',
'active' => '#ccc',
)
),
array(
'id' => 'opt-header-border',
'type' => 'border',
'title' => __( 'Header Border Option', 'bloger-admin-option' ),
'subtitle' => __( 'Only color validation can be done on this field type', 'bloger-admin-option' ),
'output' => array( '.site-header' ),
// An array of CSS selectors to apply this font style to
'desc' => __( 'This is the description field, again good for additional info.', 'bloger-admin-option' ),
'default' => array(
'border-color' => '#1e73be',
'border-style' => 'solid',
'border-top' => '3px',
'border-right' => '3px',
'border-bottom' => '3px',
'border-left' => '3px'
)
),
array(
'id' => 'opt-spacing',
'type' => 'spacing',
'output' => array( '.site-header' ),
// An array of CSS selectors to apply this font style to
'mode' => 'margin',
// absolute, padding, margin, defaults to padding
'all' => true,
// Have one field that applies to all
//'top' => false, // Disable the top
//'right' => false, // Disable the right
//'bottom' => false, // Disable the bottom
//'left' => false, // Disable the left
//'units' => 'em', // You can specify a unit value. Possible: px, em, %
//'units_extended'=> 'true', // Allow users to select any type of unit
//'display_units' => 'false', // Set to false to hide the units if the units are specified
'title' => __( 'Padding/Margin Option', 'bloger-admin-option' ),
'subtitle' => __( 'Allow your users to choose the spacing or margin they want.', 'bloger-admin-option' ),
'desc' => __( 'You can enable or disable any piece of this field. Top, Right, Bottom, Left, or Units.', 'bloger-admin-option' ),
'default' => array(
'margin-top' => '1px',
'margin-right' => '2px',
'margin-bottom' => '3px',
'margin-left' => '4px'
)
),
array(
'id' => 'opt-dimensions',
'type' => 'dimensions',
'units' => 'em', // You can specify a unit value. Possible: px, em, %
'units_extended' => 'true', // Allow users to select any type of unit
'title' => __( 'Dimensions (Width/Height) Option', 'bloger-admin-option' ),
'subtitle' => __( 'Allow your users to choose width, height, and/or unit.', 'bloger-admin-option' ),
'desc' => __( 'You can enable or disable any piece of this field. Width, Height, or Units.', 'bloger-admin-option' ),
'default' => array(
'width' => 200,
'height' => 100,
)
),
array(
'id' => 'opt-typography-body',
'type' => 'typography',
'title' => __( 'Body Font', 'bloger-admin-option' ),
'subtitle' => __( 'Specify the body font properties.', 'bloger-admin-option' ),
'google' => true,
'default' => array(
'color' => '#dd9933',
'font-size' => '30px',
'font-family' => 'Arial,Helvetica,sans-serif',
'font-weight' => 'Normal',
),
),
array(
'id' => 'opt-custom-css',
'type' => 'textarea',
'title' => __( 'Custom CSS', 'bloger-admin-option' ),
'subtitle' => __( 'Quickly add some CSS to your theme by adding it to this block.', 'bloger-admin-option' ),
'desc' => __( 'This field is even CSS validated!', 'bloger-admin-option' ),
'validate' => 'css',
),
array(
'id' => 'opt-custom-html',
'type' => 'textarea',
'title' => __( 'Custom HTML', 'bloger-admin-option' ),
'subtitle' => __( 'Just like a text box widget.', 'bloger-admin-option' ),
'desc' => __( 'This field is even HTML validated!', 'bloger-admin-option' ),
'validate' => 'html',
),
)
);
*/
/*-----------------------------------------------------------------------------------------------------------------------
social setting section
-----------------------------------------------------------------------------------------------------------------------*/
$this->sections[] = array(
'title' => __('Social Media Settings', 'bloger-admin-option'),
'desc' => __('Insert social media page url', 'bloger-admin-option'),
'icon' => 'el-icon-twitter',
'fields' => array(
array(
'id'=>'opt-facebook',
'type' => 'text',
'title' => __('Facebook', 'bloger-admin-option'),
'desc'=> __('You can add your Facebook page url here .', 'bloger-admin-option'),
'default' => 'http://facebook.com/pixelcute'
),
array(
'id'=>'opt-twitter',
'type' => 'text',
'title' => __('Twitter', 'bloger-admin-option'),
'desc'=> __('You can add your Twitter page url here.', 'bloger-admin-option'),
'default' => 'http://twitter.com/pixelcute'
),
array(
'id'=>'opt-dribbble',
'type' => 'text',
'title' => __('Dribbble', 'bloger-admin-option'),
'desc'=> __('You can add your Dribbble url here.', 'bloger-admin-option'),
'default' => 'http://dribbble.com/pixelcute'
),
array(
'id'=>'opt-flickr',
'type' => 'text',
'title' => __('Flickr', 'bloger-admin-option'),
'desc'=> __('You can add your Flickr url here.', 'bloger-admin-option'),
'default' => 'http://flickr.com/pixelcute'
),
array(
'id'=>'opt-pinterest',
'type' => 'text',
'title' => __('Pinterest', 'bloger-admin-option'),
'desc'=> __('You can add your Pinterest url here.', 'bloger-admin-option'),
'default' => 'http://pinterest.com/pixelcute'
),
array(
'id'=>'opt-youtube',
'type' => 'text',
'title' => __('Youtube', 'bloger-admin-option'),
'desc'=> __('You can add your Youtube url here.', 'bloger-admin-option'),
'default' => 'http://youtube.com/pixelcute'
),
array(
'id'=>'opt-instagram',
'type' => 'text',
'title' => __('Instagram', 'bloger-admin-option'),
'desc'=> __('You can add your instagram url here.', 'bloger-admin-option'),
'default' => 'http://instagram.com/pixelcute'
),
array(
'id'=>'opt-linkedin',
'type' => 'text',
'title' => __('Linkedin', 'bloger-admin-option'),
'desc'=> __('You can add your Linkedin url here.', 'bloger-admin-option'),
'default' => 'http://linkedin.com/pixelcute'
),
array(
'id'=>'opt-googleplus',
'type' => 'text',
'title' => __('Google Plus', 'bloger-admin-option'),
'desc'=> __('You can add your Google plus url here.', 'bloger-admin-option'),
'default' => 'https://plus.google.com/+pixelcute'
),
array(
'id'=>'opt-rss',
'type' => 'text',
'title' => __('Rss', 'bloger-admin-option'),
'desc'=> __('You can add your rss url here.', 'bloger-admin-option'),
'default' => '#'
),
),
);
/*------------------------------------------------------------------------------------------------------------------------------
Blog setting
-------------------------------------------------------------------------------------------------------------------------------*/
$this->sections[] = array(
'title' => __('Blog Settings', 'bloger-admin-option'),
'desc' => __('Edit blog settings .. ', 'bloger-admin-option'),
'icon' => 'el-icon-pencil-alt',
'fields' => array(
array(
'id'=>'limit_posts',
'type' => 'slider',
'title' => __('Limit Blog Posts', 'bloger-admin-option'),
'desc'=> __('Limit blog posts number , click and hold mouse button to increase / decrease value .. ', 'bloger-admin-option'),
'default' => '4' ,
"min" => "1",
"step" => "1",
"max" => "500"
),
array(
'id'=>'blog_order',
'type' => 'select',
'title' => __('Order Posts By', 'bloger-admin-option'),
'desc' => __('order posts by comments count or date', 'bloger-admin-option'),
'options' => array(
'1' => 'date' ,
'2' => 'comment_count'
),
'default' => '1'
),
array(
'id'=>'enable_numeric_pagination',
'type' => 'switch',
'title' => __('Enable Numeric Pagination', 'bloger-admin-option'),
'desc'=> __('You can enable numeric pagination (pages numbers) .', 'bloger-admin-option'),
'default' => 2,
'on' => 'Enabled',
'off' => 'Disabled'
),
),
);
/*-----------------------------------------------------------------------------------------------------------------------
contact setting section
-----------------------------------------------------------------------------------------------------------------------*/
$this->sections[] = array(
'icon' => 'el-icon-envelope',
'title' => __( 'Contact Settings', 'bloger-admin-option' ),
'fields' => array(
array(
'id' => 'opt-contact-phone',
'type' => 'text',
'title' => 'Phone number',
'subtitle' => __( 'Input your phone number', 'bloger-admin-option' ),
'desc' => __( 'This field for display your phone number on contact page', 'bloger-admin-option' ),
'default' => '021-321546'
),
array(
'id' => 'opt-map-url',
'type' => 'text',
'title' => __( 'Google Map', 'bloger-admin-option' ),
'subtitle' => __( 'Embed map using url.', 'bloger-admin-option' ),
'default' => 'https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3966.463698929041!2d106.823487!3d-6.2023969999999995!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2e69f41c042f08d9%3A0x61ba66ad0da4a922!2sSudirman%2C+Indonesia!5e0!3m2!1sen!2s!4v1422644945305',
'desc' => __( 'search url map from maps.google.com', 'bloger-admin-option' ),
),
),
);
/*-----------------------------------------------------------------------------------------------------------------------*/
$theme_info = '';
$theme_info .= '
' . __( 'Theme URL: ', 'bloger-admin-option' ) . '' . $this->theme->get( 'ThemeURI' ) . '
';
$theme_info .= '
' . __( 'Author: ', 'bloger-admin-option' ) . $this->theme->get( 'Author' ) . '
';
$theme_info .= '
' . __( 'Version: ', 'bloger-admin-option' ) . $this->theme->get( 'Version' ) . '
';
$theme_info .= '
' . $this->theme->get( 'Description' ) . '
';
$tabs = $this->theme->get( 'Tags' );
if ( ! empty( $tabs ) ) {
$theme_info .= '
' . __( 'Tags: ', 'bloger-admin-option' ) . implode( ', ', $tabs ) . '
';
}
$theme_info .= '
';
if ( file_exists( dirname( __FILE__ ) . '/../README.md' ) ) {
$this->sections['theme_docs'] = array(
'icon' => 'el-icon-list-alt',
'title' => __( 'Documentation', 'bloger-admin-option' ),
'fields' => array(
array(
'id' => '17',
'type' => 'raw',
'markdown' => true,
'content' => WP_Filesystem( dirname( __FILE__ ) . '/../README.md' )
),
),
);
}
/*------------------------------------------------------------------------------------------------------------------*/
$this->sections[] = array(
'icon' => 'el-icon-info-sign',
'title' => __( 'Theme Information', 'bloger-admin-option' ),
'desc' => __( 'This is the Description. Again HTML is allowed
', 'bloger-admin-option' ),
'fields' => array(
array(
'id' => 'opt-raw-info',
'type' => 'raw',
'content' => $item_info,
)
),
);
if ( file_exists( trailingslashit( dirname( __FILE__ ) ) . 'README.html' ) ) {
$tabs['docs'] = array(
'icon' => 'el-icon-book',
'title' => __( 'Documentation', 'bloger-admin-option' ),
'content' => nl2br( WP_Filesystem( trailingslashit( dirname( __FILE__ ) ) . 'README.html' ) )
);
}
}
/*------------------------------------------------------------------------------------------------------------------*/
/**
* All the possible arguments for Redux.
* For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments
* */
public function setArguments() {
$theme = wp_get_theme(); // For use with some settings. Not necessary.
$this->args = array(
// TYPICAL -> Change these values as you need/desire
'opt_name' => 'bloger_opt',
// This is where your data is stored in the database and also becomes your global variable name.
'display_name' => $theme->get( 'Name' ),
// Name that appears at the top of your panel
'display_version' => $theme->get( 'Version' ),
// Version that appears at the top of your panel
'menu_type' => 'submenu',
//Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
'allow_sub_menu' => false,
// Show the sections below the admin menu item or not
'menu_title' => __( 'Theme Options', 'bloger-admin-option' ),
'page_title' => __( 'Bloger Theme Options', 'bloger-admin-option' ),
// You will need to generate a Google API key to use this feature.
// Please visit: https://developers.google.com/fonts/docs/developer_api#Auth
'google_api_key' => '',
// Set it you want google fonts to update weekly. A google_api_key value is required.
'google_update_weekly' => false,
// Must be defined to add google fonts to the typography module
'async_typography' => true,
// Use a asynchronous font on the front end or font string
//'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader
'admin_bar' => false,
// Show the panel pages on the admin bar
'admin_bar_icon' => 'dashicons-portfolio',
// Choose an icon for the admin bar menu
'admin_bar_priority' => 50,
// Choose an priority for the admin bar menu
'global_variable' => 'bloger_options',
// Set a different name for your global variable other than the opt_name
'dev_mode' => false,
// Show the time the page took to load, etc
'update_notice' => false,
// If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo
'customizer' => false,
// Enable basic customizer support
//'open_expanded' => true, // Allow you to start the panel in an expanded way initially.
//'disable_save_warn' => true, // Disable the save warning when a user changes a field
// OPTIONAL -> Give you extra features
'page_priority' => null,
// Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
'page_parent' => 'themes.php',
// For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
'page_permissions' => 'manage_options',
// Permissions needed to access the options panel.
'menu_icon' => '',
// Specify a custom URL to an icon
'last_tab' => '',
// Force your panel to always open to a specific tab (by id)
'page_icon' => 'icon-themes',
// Icon displayed in the admin panel next to your menu_title
'page_slug' => '_options',
// Page slug used to denote the panel
'save_defaults' => true,
// On load save the defaults to DB before user clicks save or not
'default_show' => false,
// If true, shows the default value next to each field that is not the default value.
'default_mark' => '',
// What to print by the field's title if the value shown is default. Suggested: *
'show_import_export' => true,
// Shows the Import/Export panel when not used as a field.
// CAREFUL -> These options are for advanced use only
'transient_time' => 60 * MINUTE_IN_SECONDS,
'output' => true,
// Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
'output_tag' => true,
// Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
'footer_credit' => 'Bornoux Theme Powered by @pixelcute',
// Disable the footer credit of Redux. Please leave if you can help it.
// FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.
'database' => '',
// possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!
'system_info' => false,
// REMOVE
// HINTS
'hints' => array(
'icon' => 'icon-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',
),
),
)
);
// ADMIN BAR LINKS -> Setup custom links in the admin bar menu as external items.
$this->args['admin_bar_links'][] = array(
'id' => 'redux-docs',
'href' => 'http://docs.reduxframework.com/',
'title' => __( 'Documentation', 'bloger-admin-option' ),
);
$this->args['admin_bar_links'][] = array(
//'id' => 'redux-support',
'href' => 'https://github.com/ReduxFramework/bloger-admin/issues',
'title' => __( 'Support', 'bloger-admin-option' ),
);
$this->args['admin_bar_links'][] = array(
'id' => 'redux-extensions',
'href' => 'reduxframework.com/extensions',
'title' => __( 'Extensions', 'bloger-admin-option' ),
);
// SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons.
$this->args['share_icons'][] = array(
'url' => 'https://github.com/pixelcute',
'title' => 'Visit us on GitHub',
'icon' => 'el-icon-github'
//'img' => '', // You can use icon OR img. IMG needs to be a full URL.
);
$this->args['share_icons'][] = array(
'url' => 'https://www.facebook.com/pixelcute',
'title' => 'Like us on Facebook',
'icon' => 'el-icon-facebook'
);
$this->args['share_icons'][] = array(
'url' => 'http://twitter.com/pixelcute',
'title' => 'Follow us on Twitter',
'icon' => 'el-icon-twitter'
);
$this->args['share_icons'][] = array(
'url' => 'http://www.linkedin.com/company/pixelcute',
'title' => 'Find us on LinkedIn',
'icon' => 'el-icon-linkedin'
);
}
public function validate_callback_function( $field, $value, $existing_value ) {
$error = true;
$value = 'just testing';
/*
do your validation
if(something) {
$value = $value;
} elseif(something else) {
$error = true;
$value = $existing_value;
}
*/
$return['value'] = $value;
$field['msg'] = 'your custom error message';
if ( $error == true ) {
$return['error'] = $field;
}
return $return;
}
public function class_field_callback( $field, $value ) {
print_r( $field );
echo '
CLASS CALLBACK';
print_r( $value );
}
}
global $reduxConfig;
$reduxConfig = new Redux_Framework_sample_config();
} else {
echo "The class named Redux_Framework_sample_config has already been called. Developers, you need to prefix this class with your company name or you'll run into problems!";
}
/**
* Custom function for the callback referenced above
*/
if ( ! function_exists( 'redux_my_custom_field' ) ):
function redux_my_custom_field( $field, $value ) {
print_r( $field );
echo '
';
print_r( $value );
}
endif;
/**
* Custom function for the callback validation referenced above
* */
if ( ! function_exists( 'redux_validate_callback_function' ) ):
function redux_validate_callback_function( $field, $value, $existing_value ) {
$error = true;
$value = 'just testing';
/*
do your validation
if(something) {
$value = $value;
} elseif(something else) {
$error = true;
$value = $existing_value;
}
*/
$return['value'] = $value;
$field['msg'] = 'your custom error message';
if ( $error == true ) {
$return['error'] = $field;
}
return $return;
}
endif;