PHPackages                             clubdeuce/wp-share-this - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. clubdeuce/wp-share-this

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

clubdeuce/wp-share-this
=======================

An Share This library for WordPress.

0.0.6(6y ago)02.4kGPL-2.0+PHPPHP &gt;=5.4.0

Since Nov 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/clubdeuce/wp-share-this)[ Packagist](https://packagist.org/packages/clubdeuce/wp-share-this)[ Docs](http://github.com/clubdeuce/wp-share-this)[ RSS](/packages/clubdeuce-wp-share-this/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (6)Versions (7)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/85e34f3de3a1de0138fdcd13f0ba0e75aef1beab6d27f05fcfa54dbc3ab9b628/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c756264657563652f77702d73686172652d746869732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/clubdeuce/wp-share-this/?branch=master)

WP Share-This
=============

[](#wp-share-this)

This library allows for easy implementation of sharing links using the [ShareThis](https://sharethis.com). **Please note, this library is in no way affiliated with ShareThis or its subsidiaries.**

Installation
------------

[](#installation)

The easiest method for including this library is via [Composer](https://getcomposer.org). Simply run the follow command in your project root (*assuming that is where your `composer.json` is located*):

`composer require clubdeuce/wp-share-this`

This library will be autoloaded, assuming you include `vendor/autoload.php` in your project.

You can also download this library and include it manually.

Usage
-----

[](#usage)

- Register service(s): `WP_Share_This::register_service( 'twitter' )`. The full list of supported services can be found [here](http://www.sharethis.com/support/customization/how-to-set-custom-buttons/).
- Initialize the library: `WP_Share_This::initialize()`.
- Render the links: `WP_Share_This::the_sharing_links()`.

Methods
-------

[](#methods)

MethodDescriptionSinceregister\_id( *string* $share\_this\_id )Specify the ShareThis user id for tracking0.0.1register\_service( *string* $service\_name, *array* $params )Specify a service to be included. You can pass parameters specific to this service *(see below for a list of parameters)*.0.0.1the\_sharing\_links( *null/array* $params )Output the sharing links. You can pass parameters specific to this block of links *(see below for a list of parameters)*.0.0.1use\_og( *bool* $use )Specify whether to include the [OpenGraph](https://ogp.me) information in the `` of the document. Default: *true*.0.0.2Parameters
----------

[](#parameters)

The following parameters can be specified for the sharing links on a per-service basis **(not all items apply to every service)**:

NameDescriptionurlSpecifies URL (can be shortened URL) that you would like shared. Default: current global `$post` permalink.short\_urlSpecifies a shortened URL that can be used in conjunction with the data-url. Default: *null*titleSpecifies title that you would like shared. Defaults to current global `$post` title.imageSpecifies link to image you would like displayed in the shared content. Default: current global `$post` featured image if present.descriptionSpecifies summary text/description you wish to share. Default: current global `$post` excerpt.usernameSpecifies your Twitter username.messageSpecifies the body copy of e-mail shares. Default: current global `$post` excerpt.share\_countSpecify whether to include the share count for this individual link item. Default: true.### Examples:

[](#examples)

To register services with unique parameters:

```
WP_Share_This::register_service( 'twitter', array(
    'username'    => 'myTwitterHandle',
    'share_count' => false,
) );

WP_Share_This::register_service( 'facebook', array(
    'image' => 'https://example.com/image.png',
);

WP_Share_This::register_service( 'email', array(
    'message' => __( 'Look at this really interesting article I found!', 'txt_domain' ),
) );

```

To render the links with overrides to the defaults:

```
WP_Share_This::the_sharing_links( array(
    'share_count' => false,
) );

```

To render sharing links for a post other than the current global `$post` item:

```
WP_Share_This::the_sharing_links( array(
    'post' => get_post( $post_id ),
) );

```

Filters
-------

[](#filters)

This library exposes a number of filters:

FilterDescriptionParametersSince`wpst_link_classes_$service`This filter allows you to specify classes for each service link, \_e.g. `add_filter( 'wpst_classes_twitter', 'my_function' )`*array* classnames0.0.1`wpst_og_url`Allows you to filter the URL exposed via [OpenGraph](https://ogp.me)*string* URL0.0.1`wpst_og_title`Allows you to filter the title exposed via [OpenGraph](https://ogp.me)*string* title0.0.1`wpst_og_description`Allows you to filter the description exposed via [OpenGraph](https://ogp.me)*string* description0.0.1`wpst_og_image`Allows you to filter the image exposed via [OpenGraph](https://ogp.me)*string* image URL0.0.1`wpst_link_text`Allows you to filter the text displayed for the sharing link **(defaults to the service name)***string* text0.0.1

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~161 days

Recently: every ~167 days

Total

6

Last Release

2290d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59ae303db5f3f217efd33f76e9e49d0ff2084cd2824c41db6a0a88d4eb2a1a97?d=identicon)[clubdeuce](/maintainers/clubdeuce)

---

Top Contributors

[![clubdeuce](https://avatars.githubusercontent.com/u/2600497?v=4)](https://github.com/clubdeuce "clubdeuce (50 commits)")

---

Tags

phpwordpresslibrarymapssharethis

### Embed Badge

![Health badge](/badges/clubdeuce-wp-share-this/health.svg)

```
[![Health](https://phpackages.com/badges/clubdeuce-wp-share-this/health.svg)](https://phpackages.com/packages/clubdeuce-wp-share-this)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
