Last active
August 29, 2015 14:14
-
-
Save JudeRosario/152eea75cb692dfdd6b6 to your computer and use it in GitHub Desktop.
CoursePress customize colors knob.js
This file contains hidden or 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
add_action('wp_footer', 'custom_dial_colors', 100); | |
function custom_dial_colors() { | |
$script = <<< EOT | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
if ( $( ".knob" ).length ) { | |
jQuery(".knob").trigger( | |
'configure', | |
{ | |
"fgColor":"#FFFFFF", | |
"bgColor":"#000000" | |
} | |
); | |
} | |
}); | |
</script> | |
EOT; | |
echo $script; | |
} |
This file contains hidden or 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
// Special Thanks to Marko and Rheinard from WPMUDEV for this | |
add_filter( 'shortcode_atts_course_unit_details', 'change_knob_color', 10, 1 ); | |
function change_knob_color ( $atts ) { | |
$fg_color = '#000000'; | |
$bg_color = '#ffffff'; | |
if ( isset( $atts['knob_fg_color'] ) ) { | |
$atts['knob_fg_color'] = $fg_color; | |
} | |
if ( isset( $out['knob_bg_color'] ) ) { | |
$atts['knob_bg_color'] = $bg_color; | |
} | |
return $atts; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment