{"id":27991,"date":"2014-02-23T15:16:01","date_gmt":"2014-02-23T15:16:01","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/developer-share-buttons\/"},"modified":"2017-03-24T16:50:09","modified_gmt":"2017-03-24T16:50:09","slug":"developer-share-buttons","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/developer-share-buttons\/","author":13518764,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.2.0","stable_tag":"1.2.0","tested":"4.7.33","requires":"3.5","requires_php":"","requires_plugins":"","header_name":"Developer Share Buttons","header_author":"Grant Richmond","header_description":"","assets_banners_color":"","last_updated":"2017-03-24 16:50:09","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/grant.codes\/","rating":5,"author_block_rating":0,"active_installs":100,"downloads":3372,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"3"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.1.0","1.2.0","1.3.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[2275,138,3091,174],"plugin_category":[56],"plugin_contributors":[93522],"plugin_business_model":[],"class_list":["post-27991","plugin","type-plugin","status-closed","hentry","plugin_tags-developer","plugin_tags-share","plugin_tags-share-buttons","plugin_tags-social","plugin_category-social-and-sharing","plugin_contributors-terminalpixel","plugin_committers-terminalpixel"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/developer-share-buttons.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>A simple, customisable share buttons solution designed specifically for theme developers.<\/p>\n\n<p>If you would like to help out please contribute to the <a href=\"https:\/\/github.com\/terminalpixel\/Developer-Share-Buttons\">GitHub repository<\/a><\/p>\n\n<!--section=installation-->\n<p>Install the plugin in whatever way you deem fit. Once installed you can set the default settings on the options page.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>What functions are available to use?<\/dt>\n<dd><p>There are 4 functions available to use:\n1. <code>get_dev_share_buttons<\/code> returns html of share links\n2. <code>the_dev_share_buttons<\/code> a wrapper just to echo <code>get_dev_share_buttons<\/code>\n3. <code>get_dev_profile_links<\/code> returns an array of the links to social pages that are saved in the admin area\n4. <code>the_dev_profile_links<\/code> echos the links as <code>a<\/code> tags in a <code>div<\/code><\/p>\n\n<pre><code>get_dev_share_buttons and `the_dev_share_buttons` both accept 5 optional parameters:\n<\/code><\/pre>\n\n<ol>\n<li>services - An array of service ids eg <code>array( 'facebook', 'twitter', 'google' )<\/code>. Defaults to the options saved on the options page<\/li>\n<li>url - The url to share. Defaults to value of <code>get_the_permalink()<\/code><\/li>\n<li>title - The title of the item to share. Defaults to the value of <code>get_the_title()<\/code><\/li>\n<li>text - The text that appears before a service title eg \"Share on\". Defaults to the value set on the options page.<\/li>\n<li>image - The url of an image to go along with the main item, only used by certain services. Defaults to the post thumbnail.<\/li>\n<\/ol><\/dd>\n<dt>Are there default styles for this?<\/dt>\n<dd><p>Yes there are! I have added some simple default styles that you can optionally enable:<\/p>\n\n<pre><code>add_filter( 'dev_share_buttons_css', '__return_true' );\n<\/code><\/pre><\/dd>\n<dt>Adding more services<\/dt>\n<dd><p>You can add more services using a filter:<\/p>\n\n<pre><code>add_filter( 'dev_share_buttons_services', 'my_new_service' );\nfunction my_new_service( $services ) {\n    $services['myserviceid'] = array(\n        'id' =&gt; 'myserviceid',\n        'title' =&gt; 'My Service Title',\n        'url_structure' =&gt; 'http:\/\/www.shareurl.com\/?url=%1$s&amp;title=%2$s&amp;text=%3$s&amp;image=%4$s',\n        'url_after_title' =&gt; false\n    );\n    return $services;\n}\n<\/code><\/pre><\/dd>\n<dt>Adding Icons<\/dt>\n<dd><p>Icons can be added via pure css or the filters provided to add content before or after the button text:<\/p>\n\n<pre><code>\/\/ Add an svg icon to share buttons.\nfunction my_share_social_icons( $html, $service ) {\n    $icon_url = get_stylesheet_directory_uri() . '\/svg-icons.svg#' . $service['id'];\n    $icon_html = '&lt;svg&gt;&lt;use xlink:href=\"' . $icon_url . '\"&gt;&lt;\/use&gt;&lt;\/svg&gt;';\n    return $html . $icon_html;\n}\nadd_filter( 'dev_share_buttons_after_share_text', 'my_share_social_icons', 10, 2 );\n\n\/\/ Add a png icon to profile links.\nfunction my_profile_social_icons( $html, $service ) {\n    $icon_url = get_stylesheet_directory_uri() . '\/social-icons\/' . $service['id'] . '.png';\n    $icon_html = '&lt;img src=\"' . $icon_url . '\" \/&gt;';\n    return $html . $icon_html;\n}\nadd_filter( 'dev_share_buttons_after_profile_text', 'my_profile_social_icons', 10, 2 );\n<\/code><\/pre><\/dd>\n<dt>Disabling the Web Share API<\/dt>\n<dd><p>The Web Share API is disabled by default but I recommend enabling it as it will display a single share button instead of the multiple buttons if the browser supports it. If you wish to enable this feature you can add a filter:<\/p>\n\n<pre><code>add_filter( 'dev_share_buttons_share_api', '__return_true' );\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Prevent <code>the_<\/code> functions from returning values<\/li>\n<li>Add spaces between profile links<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Fix profile link widget<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Improve support for non post object based pages<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Add <code>rel=\"me\"<\/code> support for profile links<\/li>\n<\/ul>\n\n<h4>1.0.6<\/h4>\n\n<ul>\n<li>Update to all https links<\/li>\n<li>Use updated twitter and pinterest urls<\/li>\n<li>Url encode more things for better character support<\/li>\n<\/ul>\n\n<h4>1.0.7<\/h4>\n\n<ul>\n<li>Add extra filters to add content before and after button text (useful for icons)<\/li>\n<li>Update coding standard<\/li>\n<\/ul>\n\n<h4>1.0.8<\/h4>\n\n<ul>\n<li>Use <code>rawurlencode<\/code> to improve compatibility with some services<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Add some optional default styles<\/li>\n<li>Add Medium, Messenger, Skype, Snapchat, WeChat, WhatsApp and YouTube profile links<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Add support for the Web Share API<\/li>\n<\/ul>","raw_excerpt":"A super lightweight social sharing solution using either the Web Share API or simple sharing links.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/27991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=27991"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/terminalpixel"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=27991"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=27991"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=27991"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=27991"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=27991"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=27991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}