Skip to content

Instantly share code, notes, and snippets.

@dovy
Last active December 27, 2015 19:09
Show Gist options
  • Save dovy/7374430 to your computer and use it in GitHub Desktop.
Save dovy/7374430 to your computer and use it in GitHub Desktop.
<?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'
),
<?php
/**
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 testCompiler() {
echo "Compiler hook!";
}
add_action('redux-compiler-redux_demo-sample-file', 'testCompiler');
// This hook assumes your opt_name is redux_demo. Replace with your own.
@darknailblue
Copy link

This should be updated as "-sample-file" isn't needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment