{"id":171088,"date":"2023-03-16T22:19:44","date_gmt":"2023-03-16T22:19:44","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/better-share-buttons\/"},"modified":"2025-11-06T10:32:02","modified_gmt":"2025-11-06T10:32:02","slug":"better-share-buttons","status":"publish","type":"plugin","link":"https:\/\/kir.wordpress.org\/plugins\/better-share-buttons\/","author":9548563,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.9.4","stable_tag":"1.9.4","tested":"6.9.4","requires":"5.7","requires_php":"7.0","requires_plugins":null,"header_name":"Better Share Buttons","header_author":"KubiQ","header_description":"Share buttons for social networks and more","assets_banners_color":"49a1e2","last_updated":"2025-11-06 10:32:02","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/jakubnovaksl","header_plugin_uri":"https:\/\/wp-speedup.eu","header_author_uri":"https:\/\/kubiq.sk","rating":0,"author_block_rating":0,"active_installs":20,"downloads":1595,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.9":{"tag":"1.9","author":"kubiq","date":"2024-03-21 21:12:59"},"1.9.1":{"tag":"1.9.1","author":"kubiq","date":"2024-09-06 11:32:17"},"1.9.2":{"tag":"1.9.2","author":"kubiq","date":"2024-10-03 08:38:52"},"1.9.3":{"tag":"1.9.3","author":"kubiq","date":"2025-07-25 12:13:20"},"1.9.4":{"tag":"1.9.4","author":"kubiq","date":"2025-11-06 10:32:02"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2885255,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2885255,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2885255,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2885255,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.9","1.9.1","1.9.2","1.9.3","1.9.4"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2885255,"resolution":"1","location":"assets","locale":""}},"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[172,498,138,324,154],"plugin_category":[50,56],"plugin_contributors":[81042],"plugin_business_model":[],"class_list":["post-171088","plugin","type-plugin","status-publish","hentry","plugin_tags-buttons","plugin_tags-icons","plugin_tags-share","plugin_tags-sharing","plugin_tags-social-media","plugin_category-media","plugin_category-social-and-sharing","plugin_contributors-kubiq","plugin_committers-kubiq"],"banners":{"banner":"https:\/\/ps.w.org\/better-share-buttons\/assets\/banner-772x250.png?rev=2885255","banner_2x":"https:\/\/ps.w.org\/better-share-buttons\/assets\/banner-1544x500.png?rev=2885255","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/better-share-buttons\/assets\/icon-128x128.png?rev=2885255","icon_2x":"https:\/\/ps.w.org\/better-share-buttons\/assets\/icon-256x256.png?rev=2885255","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/better-share-buttons\/assets\/screenshot-1.png?rev=2885255","caption":""}],"raw_content":"<!--section=description-->\n<p>Easily use <code>[better_share_buttons]<\/code> shortcode anywhere you want.\nCreate your own styles, or choose from existing ones.\nThis plugin is optimized for fastest websites - it will not load any JS files and it will load CSS file only when it is needed.<\/p>\n\n<p><strong>This plugin allows you to:<\/strong><\/p>\n\n<ul>\n<li>create multiple social share icon styles<\/li>\n<li>use shortcode to display share icons anywhere you want<\/li>\n<li>create your own styles in your theme folder<\/li>\n<li>customize basic settings directly in admin<\/li>\n<li>use different icons for social networks<\/li>\n<\/ul>\n\n<h3>Hooks<\/h3>\n\n<p><strong>customize wrapper classes<\/strong><\/p>\n\n<pre><code>add_filter( 'share_buttons_classes', function( $classes, $share_buttons_settings, $share_buttons_id ){\n    $classes[] = 'my-custom-class';\n    return $classes;\n}, 10, 3 );\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<p><strong>customize wrapper CSS output<\/strong><\/p>\n\n<pre><code>add_filter( 'share_buttons_styles', function( $style, $share_buttons_settings, $share_buttons_id ){\n    $style[] = '--my-var: 50px';\n    return $style;\n}, 10, 3 );\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<p><strong>customize html form more button<\/strong><\/p>\n\n<pre><code>add_filter( 'better_share_buttons_more', function( $html, $share_buttons_settings, $share_buttons_id ){\n    \/\/ replace SVG icon path with a custom one\n    $html = str_replace( 'M18 14V8h-4v6H8v4h6v6h4v-6h6v-4h-6z', 'M18.2 4.2C18.2 3 17.2 2 16 2s-2.2 1-2.2 2.2v9.7H4.2C3 13.8 2 14.8 2 16s1 2.2 2.2 2.2h9.7v9.7c0 1.2 1 2.2 2.2 2.2s2.2-1 2.2-2.2v-9.7H28c1.2 0 2.2-1 2.2-2.2s-1-2.2-2.2-2.2h-9.7V4.2z', $html );\n    return $html;\n}, 10, 3 );\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<p><strong>add custom icon for any network<\/strong><\/p>\n\n<pre><code>add_filter( 'share_buttons_icons', function( $icon, $slug, $share_buttons_settings, $share_buttons_id ){\n    if( $slug == 'facebook' ){\n        \/\/ add custom SVG path and you will be able to select it in admin\n        $icon[] = 'M29.3 16c0-7.4-6-13.3-13.3-13.3C8.6 2.7 2.7 8.6 2.7 16c0 6.5 4.6 11.8 10.7 13.1V20h-2.7v-4h2.7v-3.3c0-2.6 2.1-4.7 4.7-4.7h3.3v4h-2.7c-.7 0-1.3.6-1.3 1.3V16h4v4h-4v9.3c6.7-.7 11.9-6.4 11.9-13.3z';\n    }\n    return $icon;\n}, 10, 4 );\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<p><strong>control shared URL<\/strong><\/p>\n\n<pre><code>add_filter( 'better_share_buttons_permalink', function( $url ){\n    \/\/ ...\n    return $url;\n});\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<p><strong>control shared title<\/strong><\/p>\n\n<pre><code>add_filter( 'better_share_buttons_title', function( $title ){\n    \/\/ ...\n    return $title;\n});\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<p><strong>control HTML output for any network<\/strong><\/p>\n\n<pre><code>add_filter( 'better_share_buttons_link', function( $html, $slug, $share_buttons_settings, $share_buttons_id ){\n    if( $slug == 'facebook' ){\n        $html = str_replace( 'https:\/\/facebook.com\/sharer\/sharer.php?', 'https:\/\/facebook.com\/sharer\/sharer.php?xxx=yyy&amp;', $html );\n    }\n    return $html;\n}, 10, 4 );\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<p><strong>add something before or after your share buttons<\/strong><\/p>\n\n<pre><code>add_action( 'before_share_buttons', function( $share_buttons_settings, $atts ){ \/\/ or after_share_buttons\n    if( $atts['id'] == 12345 ){\n        echo '&lt;div class=\"before-share-buttons\"&gt;' . __( 'Sharing is caring', 'theme' ) . '&lt;\/div&gt;';\n    }\n}, 10, 2 );\n<\/code><\/pre>\n\n<p>&nbsp;<\/p>\n\n<h3>Create your own styles<\/h3>\n\n<p>Create new folder <code>better-share-buttons<\/code> inside your theme folder and put iniside style files <code>xyz.css<\/code> and <code>xyz.json<\/code>.<\/p>\n\n<p>Style <code>xyz<\/code> will automatically appear in the admin settings.<\/p>\n\n<p>Content of JSON file is used to manipulate settings in admin when you select that style:<\/p>\n\n<pre><code>{\n    \"visible_buttons\": 999,\n    \"bsb_mx\": 0,\n    \"bsb_my\": 0,\n    \"bsb_px\": 5,\n    \"bsb_py\": 5,\n    \"bsb_br\": 0,\n    \"bsb_fz\": 0,\n    \"bsb_iz\": 32,\n    \"bsb_lls\": 0,\n    \"bsb_lrs\": 0\n}\n<\/code><\/pre>\n\n<p>Content of CSS file should define your style:<\/p>\n\n<pre><code>.better_share_buttons.bsb-style-xyz{}\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.9.4<\/h4>\n\n<ul>\n<li>tested on WP 6.9<\/li>\n<li>new network - Browser share - using native navigator.share and navigator.clipboard.writeText as a fallback<\/li>\n<\/ul>\n\n<h4>1.9.3<\/h4>\n\n<ul>\n<li>tested on WP 6.8<\/li>\n<li>added action hook before_share_buttons<\/li>\n<li>added action hook after_share_buttons<\/li>\n<\/ul>\n\n<h4>1.9.2<\/h4>\n\n<ul>\n<li>new icon for WhatsApp<\/li>\n<li>fix icon size for facebook<\/li>\n<li>commented dev code to list all icons in admin<\/li>\n<\/ul>\n\n<h4>1.9.1<\/h4>\n\n<ul>\n<li>tested on WP 6.6<\/li>\n<li>fix missing filter for custom icons in admin<\/li>\n<\/ul>\n\n<h4>1.9<\/h4>\n\n<ul>\n<li>tested on WP 6.5<\/li>\n<li>fix whatsapp link broken by esc_url<\/li>\n<\/ul>\n\n<h4>1.8.1<\/h4>\n\n<ul>\n<li>new icon for copy link<\/li>\n<\/ul>\n\n<h4>1.8<\/h4>\n\n<ul>\n<li>tested on WP 6.4<\/li>\n<\/ul>\n\n<h4>1.7<\/h4>\n\n<ul>\n<li>new unicolor-icons style<\/li>\n<\/ul>\n\n<h4>1.6<\/h4>\n\n<ul>\n<li>new icon for email<\/li>\n<\/ul>\n\n<h4>1.5<\/h4>\n\n<ul>\n<li>new unicolor-list style<\/li>\n<\/ul>\n\n<h4>1.4<\/h4>\n\n<ul>\n<li>new inline-squares style<\/li>\n<li>new twitter icon<\/li>\n<li>new copy link icon<\/li>\n<li>new data-network link attribute for easier CSS targeting<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>added filters for shared URL and shared TITLE<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>new icon for copy link<\/li>\n<li>new unicolor-hover style<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>optimize settings page<\/li>\n<li>fix floating style jump<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Release<\/li>\n<\/ul>","raw_excerpt":"Easily use [better_share_buttons] shortcode anywhere you want.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/171088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=171088"}],"author":[{"embeddable":true,"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/kubiq"}],"wp:attachment":[{"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=171088"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=171088"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=171088"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=171088"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=171088"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/kir.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=171088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}