Download the PHP package clubdeuce/wp-share-this without Composer

On this page you can find all versions of the php package clubdeuce/wp-share-this. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-share-this

Scrutinizer Code Quality

WP Share-This

This library allows for easy implementation of sharing links using the ShareThis. Please note, this library is in no way affiliated with ShareThis or its subsidiaries.

Installation

The easiest method for including this library is via Composer. 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

Methods

Method Description Since
register_id( string $share_this_id ) Specify the ShareThis user id for tracking 0.0.1
register_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.1
the_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.1
use_og( bool $use ) Specify whether to include the OpenGraph information in the <head> of the document. Default: true. 0.0.2

Parameters

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

Name Description
url Specifies URL (can be shortened URL) that you would like shared. Default: current global $post permalink.
short_url Specifies a shortened URL that can be used in conjunction with the data-url. Default: null
title Specifies title that you would like shared. Defaults to current global $post title.
image Specifies link to image you would like displayed in the shared content. Default: current global $post featured image if present.
description Specifies summary text/description you wish to share. Default: current global $post excerpt.
username Specifies your Twitter username.
message Specifies the body copy of e-mail shares. Default: current global $post excerpt.
share_count Specify whether to include the share count for this individual link item. Default: true.

Examples:

To register services with unique parameters:

To render the links with overrides to the defaults:

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

Filters

This library exposes a number of filters:

Filter Description Parameters Since
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 classnames 0.0.1
wpst_og_url Allows you to filter the URL exposed via OpenGraph string URL 0.0.1
wpst_og_title Allows you to filter the title exposed via OpenGraph string title 0.0.1
wpst_og_description Allows you to filter the description exposed via OpenGraph string description 0.0.1
wpst_og_image Allows you to filter the image exposed via OpenGraph string image URL 0.0.1
wpst_link_text Allows you to filter the text displayed for the sharing link (defaults to the service name) string text 0.0.1

All versions of wp-share-this with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package clubdeuce/wp-share-this contains the following files

Loading the files please wait ....