About this plugin
Easily use [better_share_buttons] shortcode anywhere you want.
Create your own styles, or choose from existing ones.
This plugin is optimized for fastest websites – it will not load any JS files and it will load CSS file only when it is needed.
This plugin allows you to:
- create multiple social share icon styles
- use shortcode to display share icons anywhere you want
- create your own styles in your theme folder
- customize basic settings directly in admin
- use different icons for social networks
Hooks
customize wrapper classes
add_filter( 'share_buttons_classes', function( $classes, $share_buttons_settings, $share_buttons_id ){ $classes[] = 'my-custom-class'; return $classes; }, 10, 3 );
customize wrapper CSS output
add_filter( 'share_buttons_styles', function( $style, $share_buttons_settings, $share_buttons_id ){ $style[] = '--my-var: 50px'; return $style; }, 10, 3 );
customize html form more button
2z', $html ); return $html; }, 10, 3 );
add custom icon for any network
3z'; } return $icon; }, 10, 4 );
control shared URL
add_filter( 'better_share_buttons_permalink', function( $url ){ //... return $url; });
control shared title
add_filter( 'better_share_buttons_title', function( $title ){ //... return $title; });
control HTML output for any network
xxx=yyy&', $html ); } return $html; }, 10, 4 );
add something before or after your share buttons
add_action( 'before_share_buttons', function( $share_buttons_settings, $atts ){ // or after_share_buttons if( $atts['id'] == 12345 ){ echo '<div class="before-share-buttons">'. __( 'Sharing is caring', 'theme' ). '</div>'; } }, 10, 2 );
Create your own styles
json.
Style xyz will automatically appear in the admin settings.
Content of JSON file is used to manipulate settings in admin when you select that style:
{ "visible_buttons": 999, "bsb_mx": 0, "bsb_my": 0, "bsb_px": 5, "bsb_py": 5, "bsb_br": 0, "bsb_fz": 0, "bsb_iz": 32, "bsb_lls": 0, "bsb_lrs": 0 }
Content of CSS file should define your style:
bsb-style-xyz{}