Using Bootstrap Buttons as WPDM Download Button

As you know, There was custom button class support in WordPress Download Manager Pro v3, but in WordPress Download Manager v4, we have removed the option as now there is an amazing free add-on to use custom image as download button. But still a few users want their Bootstrap button back. Anyhow It is pretty easy to apply bootstrap button styles. What you need to do is, use filter hook “wdm_before_fetch_template” to customize current button class and apply bootstrap buttons. Simply add following code at the end of your theme functions.php

function wpdm_bootstrap_buttons($package_data){
    $package_data['btnclass'] = 'btn btn-primary';
    return $package_data;
}
add_filter("wdm_before_fetch_template", "wpdm_bootstrap_buttons");

 

and in example code , instead of “btn-primary” you can use following alternative classes for different style of button:

  • btn-success
  • btn-info
  • btn-warning
  • btn-danger

for changing button size you can add any of following classes:

  • btn-lg
  • btn-sm
  • btn-xs

 


Leave a Reply