Skip to content

Instantly share code, notes, and snippets.

type id title subtitle desc compiler class fold options default data transparent width height placeholder tiles presets style raw_html header icon url preview username multi min max step units top right bottom left On Off rows google family size script color
button_set X X X X X X X X X
@dovy
dovy / redux_get_variables.php
Last active October 3, 2016 10:13
Simple method for recovering redux values if you wish to not use the global variable.
<?
function redux_get_variables( $name, $key = false ) {
global $MY_VAR_NAME; // Update to your opt_name or global_variable name
$options = $MY_VAR_NAME; // Update to your opt_name or global_variable name
$var = ""; // Set this to your preferred default value
if ( empty( $name ) && !empty( $options ) ) {
$var = $options;
} else {
typography6: {
family: "Arial, Helvetica, sans-serif"
google: "false"
style: "400-italic"
script: ""
size: "33"
height: "42"
color: "#939393"
}
<?
// YOUR OLD VERSION
array(
'id'=>'typography',
'type' => 'typography',
'title' => __('Typography', 'redux-framework'),
'subtitle'=> __('Typography option with each property can be called individually.', 'redux-framework'),
'default'=> array(
'color'=>"#333",
<?
$field = array(
'id'=>'18',
'type' => 'button_set',
'title' => __('Button Set Option', 'redux-framework'),
'subtitle' => __('No validation can be done on this field type', 'redux-framework'),
'desc' => __('This is the description field, again good for additional info.', 'redux-framework'),
'options' => array('1' => 'Opt 1','2' => 'Opt 2','3' => 'Opt 3'), //Must provide key => value pairs
'default' => '2'
);
<?php
$field = array(
'id'=>'header-border',
'type' => 'border',
'title' => __('Header Border Option', 'redux-framework'),
'subtitle' => __('Only color validation can be done on this field type', 'redux-framework'),
'desc' => __('This is the description field, again good for additional info.', 'redux-framework'),
'default' => array('color' => '#1e73be', 'style' => 'solid', 'width'=>'3')
),
<?php
if(!class_exists('ReduxFramework')){
require_once(dirname(__FILE__) . '/ReduxFramework/framework.php');
}
@dovy
dovy / addAndOverridePanelCSS.php
Last active December 22, 2015 16:49
Showing you how to add to or override the Redux CSS values.
<?php
function addAndOverridePanelCSS() {
wp_dequeue_style( 'redux-css' );
wp_register_style(
'redux-custom-css',
'http://urltomyfile',
array( 'farbtastic' ), // Notice redux-css is removed and the wordpress standard farbtastic is included instead
time(),
'all'
);
@dovy
dovy / Redux-required-arg-exampes.php
Last active March 4, 2021 14:16
Example of the required attribute for the Redux Framework.
<?php
$options = array(
'required' => array('id','equals',array( 1,3 ) ) // Multiple values
);
$options = array(
'required' => array('id','equals', array( 1 ) ) // Single value
);
@dovy
dovy / Options Folding
Last active December 22, 2015 13:28
Example folding for the Redux Framework.
<?php
array(
'id'=>'switch-custom',
'type' => 'switch',
'title' => __('Switch - Custom Titles', 'redux-framework'),
'subtitle'=> __('Look, it\'s on! Also hidden child elements!', 'redux-framework'),
"default" => 0,
'on' => 'Enabled',
'off' => 'Disabled',
),