-
-
Save corradomatt/bc626862e4d99708118e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Redux::setSection( $opt_name, array( | |
'title' => __( 'Text Area', 'redux-framework-demo' ), | |
'desc' => __( 'For full documentation on this field, visit: ', 'redux-framework-demo' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>', | |
'id' => 'opt-textarea-subsection', | |
'subsection' => true, | |
'fields' => array( | |
array( | |
'id' => 'background-parallax', | |
'type' => 'select', | |
'title' => __( 'Text Area Field', 'redux-framework-demo' ), | |
'subtitle' => __( 'Subtitle', 'redux-framework-demo' ), | |
'desc' => __( 'Field Description', 'redux-framework-demo' ), | |
'compiler' => true, | |
'default' => 'Default Text', | |
), | |
) | |
) ); | |
add_filter('redux/options/redux_demo/compiler', 'compiler_action', 10, 3); | |
function compiler_action($options, $css, $changed_values) { | |
if (in_array(array('background','header'), $changed_values)) { | |
//Run compile 1!!! | |
} | |
if (in_array(array('footer', 'sidebar'), $changed_values)) { | |
//Run compile 2!!! | |
} | |
$css = ' | |
.top .container { | |
background-position: '.$options['background-parallax'].'; | |
} | |
@media (max-width: 600px) { | |
.container { | |
background-position: repeat !important; | |
} | |
} | |
@media (max-width: 350px) { | |
.container { | |
background-position: fixed; | |
} | |
} | |
'; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment