Skip to content

Instantly share code, notes, and snippets.

<?php
global $pagenow;
if ($pagenow !== "post.php" || $pagenow !== "post-new.php") {
return;
}
@dovy
dovy / filters.md
Last active December 28, 2015 03:49
  • Sections
  • apply_filters('redux-sections',$sections);
  • apply_filters('redux/options/'.$this->args['opt_name'].'/sections',$sections);
  • Local (Internationalization)
  • apply_filters( 'redux/textdomain/'.$this->args['opt_name'], get_locale(), $domain );
  • Wordpress Data
  • apply_filters( 'redux/options/'.$this->args['opt_name'].'/wordpress_data/'.$type.'/', $data );
  • apply_filters( 'redux/options/'.$this->args['opt_name'].'/data/'.$type, $data );
  • Font Icons
  • apply_filters('redux-font-icons',array());
@dovy
dovy / field.php
Last active December 27, 2015 19:09
<?php
array(
'id'=>'text',
'type' => 'text',
'title' => __('Test Compiler', 'redux-framework-demo'),
'subtitle' => __('This is to test the compiler hook.', 'redux-framework-demo'),
'desc' => __('Each time this field is set, a flag is set. On save, that flag initates a compiler hook!', 'redux-framework-demo'),
'compiler' => true,
'default' => 'Test Compiler'
),
{
"_id": "5f286d8560c3f0abb92c6232eb8187fd",
"_rev": "9-d42b5eb435a4dfc13afc372493e64037",
"created_at": 1383370083,
"site": {
"hash": "5f286d8560c3f0abb92c6232eb8187fd",
"version": "3.7.1",
"multisite": false,
"users": "0",
"lang": "en_US",
@dovy
dovy / epsforwordpress.php
Created November 1, 2013 22:52
Add to your functions.php
<?php
function custom_upload_mimes ( $existing_mimes=array() ) {
// Add *.EPS files to Media upload
$existing_mimes['eps'] = 'application/postscript';
return $existing_mimes;
}
add_filter('upload_mimes', 'custom_upload_mimes');
<?php
/*
*
* Set the text domain for the theme or plugin.
*
*/
define('Redux_TEXT_DOMAIN', 'atd-opts');
/*
*
<?php
if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' ) ) {
require_once( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' );
}
if ( !isset( $redux_demo ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' ) ) {
require_once( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' );
}
ReduxCore
loader.php (framework.php whatever really)
coreassets
js
css
img
modules/extensions??
optionspanel
customizer
metabox
<?php
function useReduxVariables() {
// Redux does some nifty setup things. To use the variables inside your functions.php file you will need to run your
// code inside a function run at the init hook or later.
// In this example we assume that demo mode is turned on. You can sub your variable name here to get your values.
global $redux_demo;
print_r($redux_demo);
}