EA Share Count
Contributors: jaredatch, billerickson
Tags: facebook, linkedin, pinterest, share, share buttons, social, stumbleupon, twitter
Requires at least: 4.1
Tested up to: 4.7.0
Stable tag: 1.8.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
EA Share Count is a lean plugin for quickly retrieving, caching, and displaying various social sharing counts and buttons. It's developer-friendly and very extensible.
Download the plugin here. Once installed, go to Settings > Share Count to customize.
Use the "Retrieve Share Counts From" checkboxes to select which APIs you'd like to query for share counts. By default it will not receive any share counts. The Facebook API requires you to provide an Access Token.
The "Share Buttons to Display" field lets you control which share buttons to display and in what order. They can be automatically added before and/or after your site's content by selecting a Theme Location. Alternatively you can use
ea_share()->from->display() in your theme to display the buttons.
1. Settings Page.
2. Fancy Style (default)
3. Slim Style
4. Bubble Style
5. Email Popup
You can also use the ea_share() function to access any of the internal methods. The most common use will be to get a specific share count. See all options here.
ea_share()->core->count( get_the_ID(), 'facebook' );Provides the number of facebook likes/shares/comments
ea_share()->core->count( get_the_ID(), 'included_total' );Provides the total count from all the services specified in settings
ea_share()->front->display( $location, $echo );Display the share buttons, as configured in Settings > Share Count. The $location is an identifying class added to wrapping HTML (useful if you have buttons in multiple locations). $echo is a boolean value indicating whether the buttons should be echoed or returned.
There are also many filters in place to customize the plugin. Here are some code snippets.
ea_share_count_displayCustomize what is displayed in the share count area.
ea_share_count_display_wrap_formatCustomize the wrapping class and format of share count area.
ea_share_count_theme_locationsSpecify which hooks/filters are used for the "Before Content" and "After Content" share buttons. See the code for more information.
ea_share_count_linkAn array of elements used to form the share link. See the code for more information.
ea_share_count_link_urlThe URL being shared
ea_share_count_default_imageDefault image used by Pinterest for generic URLs.
ea_share_count_single_imageImage used by Pinterest for singular content (post, page...). Set to Featured Image by default.
ea_share_count_site_urlWhat URL is used if you specify 'site' as the ID. Defaults to home_url().
ea_share_count_singleThe share count used when the requested service isn't recognized. If you're adding custom services, you'll use this to set the share count for that service.
ea_share_count_totalCustomize what is used as the 'total_count'
ea_share_count_load_cssDisable the CSS from loading, like this. Note that the icons are part of the CSS, so you'll need to include your own icon font.
ea_share_count_email_modalEnable email modal window in use cases where the share button is manually being called.
ea_share_count_email_labelsEmail modal window labels for different fields. See the code for more information.
ea_share_count_email_subjectSubject used in email modal. Defaults to "Your friend $from_name has shared an article with you"
ea_share_count_email_bodyBody of email used in email modal. Defaults to Post Title and Post Permalink.
ea_share_count_email_headersEmail headers used by email modal. See the code for more information.
ea_share_count_update_incrementsHow frequently the share counts are updated. See the code for default increments.
ea_share_count_api_paramsCustomize the global API parameters (currently only contains URL). Example
ea_share_count_admin_servicesWhat services are available on the settings page
ea_share_count_query_servicesWhat services are available to be queried for share counts
ea_share_count_optionsThe options used on the settings page