Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Toolbox Customizer > 1.6.2 needed
- /**
- * these variables for LESS are define in your plugin
- * notice the filter, that's the hookname that is going to get applied
- * if more variables need the same filter you can do that like shown below
- */
- 'dbraflex_button_border_width' => toolbox_customizer_css::gtm( 'dbraflex_button_border_width' , array( 'filter' => 'dbraflex_false_on_zero' ) , 'px' ),
- 'dbraflex_some_other_border_width' => toolbox_customizer_css::gtm( 'dbraflex_some_other_border_width' , array( 'filter' => 'dbraflex_false_on_zero' ) , 'px' ),
- /**
- * Then, somewhere at the end of the file or at least outside of the load_my_variables() function you hook this function to
- * the filter_hook
- */
- add_filter( 'dbraflex_false_on_zero' , function( $value , $theme_mod , $unit ) {
- if ( get_theme_mod( $theme_mod ) == 0 ) return false;
- return $value;
- } , 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement