This file is a documention for the plugin Juiz Social Post Sharer.
It will be updated each time with the plugin features.
Please, note that this documentation concerne all versions of the plugin. Read the "since" mention on each feature.
You like this plugin and want to support it?
Donate
Tweet it
If you need to use custom styles for your buttons/links or its container:
/* The big container */
.juiz_sps_links { }
/* Dynamic classes depending on position */
.juiz_sps_displayed_bottom { }
.juiz_sps_displayed_both { }
.juiz_sps_displayed_top { }
/* The <p> hidden to introduce list of links */
.juiz_sps_maybe_hidden_text { }
/* The list of buttons/links */
.juiz_sps_links_list { }
/* An item of this list (<li> element by default) */
.juiz_sps_item { }
/* Each item as a second class depending on social network name */
.juiz_sps_link_facebook { }
.juiz_sps_link_twitter { }
.juiz_sps_link_google { }
.juiz_sps_link_pinterest { }
.juiz_sps_link_linkedin { }
.juiz_sps_link_viadeo { }
.juiz_sps_link_digg { }
.juiz_sps_link_stumbleupon { }
.juiz_sps_link_mail { }
.juiz_sps_link_weibo { }
/* Each item has its icon */
.juiz_sps_icon { }
/* and its name */
.juiz_sps_network_name { }
/* Counters */
/* for each item */
.juiz_sps_counter { }
.juiz_sps_totalcount_item { }
/* the total count bubble */
.juiz_sps_totalcount { }
You can improve your CSS editions by using Firebug plugin.
This plugin has a Shortcode, a kind of BBcode, that allows you to display those buttons where you want.
This shortcode uses the keyword juiz_social
or juiz_sps
(since 1.2.1), two particular words to oust any conflict with other plugins.
[juiz_social]
Used in a post, this shortcode all the buttons available (all social networks).
Morever, buttons are selectable with there slug in a shortcode parameter:
buttons
: keywords available are "twitter, facebook, google, linkedin, digg, viadeo, stumbleupon, weibo, pinterest, vk, mail"counters
: (0
by default), use 1
to show counters.current
: (1
by default), use 0
to share permalink value instead of current URL (I advice you to keep the value 1
if you use shortcode in a widget).url
: (permalink
by default), use permalink
, siteurl
or string (url value)
to share the value you set instead of current URL by default. since 1.3.3.7Example of use:
[juiz_social buttons="twitter,facebook,google"]
This sample of code show 3 buttons : Twitter, Facebook and Google+ social networks.
Template functions allow you to display list of buttons inside any theme template you need.
There are two functions: juiz_sps($networks, $show_counters, $share_current_page, $is_shortcode, $url_to_share)
and get_juiz_sps($networks, $show_counters, $share_current_page, $is_shortcode, $url_to_share)
Parameters
$networks
(array) – the complete list of network available is (as array) array('twitter', 'facebook', 'google', 'linkedin', 'digg', 'viadeo', 'stumbleupon', 'weibo', 'pinterest', 'vk', 'mail')
$show_counters
(int) – show or hide counters. 1
show counters, 0
hide counters.0
$share_current_page
(int) – share the current page or the "permalink" value. 1
share the current page, 0
share the value of permalink. Note: sometimes, both value return the same URL to share.1
$is_shortcode
(int) – share the current page or the "permalink" value. 1
share the current page, 0
share the value of permalink. Note: sometimes, both value return the same URL to share.0
$url_to_share
(string) – the URL to share. permalink
to share the current page permalink, siteurl
to share the main site URL, url-value
to share a custom URL.NULL
since 1.3.3.7Example of use:
<?php
/* your social networks */
$jsps_networks = array( 'twitter', 'facebook', 'google', 'mail' );
/* show counters */
$show_counters = 1;
/* display buttons */
juiz_sps( $jsps_networks, $show_counters );
?>
juiz_sps()
makes an echo
, if you need to save data in a variable, use get_juiz_sps()
.
Example of use:
<?php
/* your social networks */
$jsps_networks = array( 'twitter', 'facebook', 'google', 'mail' );
/* set variable */
$my_buttons = get_juiz_sps($jsps_networks, 1); // 1 to show counters
/* more later, display buttons */
echo $my_buttons;
?>
This plugin allows you to change some parts of its structure without broke the core.
The following samples of code can be inserted in the functions.php file.
juiz_sps_before_the_sps
Add a content just before the container of this plugin (a div
)
<?php
if( !function_exists('before_the_jsps_plugin')) {
function before_the_jsps_plugin() {
return '<div class="another_container">';
}
}
add_filter('juiz_sps_before_the_sps', 'before_the_jsps_plugin');
?>
juiz_sps_after_the_sps
Add a content just after the container of this plugin (a div
).
<?php
if( !function_exists('after_the_jsps_plugin')) {
function after_the_jsps_plugin() {
return '<small>
plugin by
<a href="http://creativejuiz.fr">CreativeJuiz</a>
</small>';
}
}
add_filter('juiz_sps_after_the_sps', 'after_the_jsps_plugin');
?>
juiz_sps_container_tag
Change the big container tag of the list (<div>
) by another, for example:
<?php
if( !function_exists('replacing_by_span')) {
function replacing_by_span() {
return 'span';
}
}
add_filter('juiz_sps_container_tag', 'replacing_by_span');
?>
juiz_sps_list_container_tag
Change the tag of the list container (<ul>
) by another, for example:
<?php
if( !function_exists('replacing_by_div')) {
function replacing_by_div() {
return 'div';
}
}
add_filter('juiz_sps_list_container_tag', 'replacing_by_div');
?>
juiz_sps_phrase_tag
Change the intro phrase tag (hidden with default style) (<p>
) by another, for example:
<?php
if( !function_exists('replacing_by_span')) {
function replacing_by_span() {
return 'span';
}
}
add_filter('juiz_sps_phrase_tag', 'replacing_by_span');
?>
If you want to remove this sentence, see the juiz_sps_hide_intro_phrase
hook
juiz_sps_intro_phrase_text
(since v1.3.0)Change the intro phrase content (the text) by what you want, for example:
<?php
if( !function_exists('replacing_intro_phrase_text')) {
function replacing_intro_phrase_text() {
return __('Share my awesome content');
}
}
add_filter('juiz_sps_intro_phrase_text', 'replacing_intro_phrase_text');
?>
If you want to remove this sentence, see the juiz_sps_hide_intro_phrase
hook
juiz_sps_container_classes
Adds your own classes to the container element:
<?php
if( !function_exists('juiz_sps_container_classes')) {
function juiz_sps_container_classes() {
return 'class1 class2';
}
}
add_filter('juiz_sps_container_classes', 'add_container_classes');
?>
juiz_sps_list_of_item_tag
Change the tag of an item of the list (<li>
) by another, for example:
<?php
if( !function_exists('replacing_by_div')) {
function replacing_by_div() {
return 'div';
}
}
add_filter('juiz_sps_list_of_item_tag', 'replacing_by_div');
?>
juiz_sps_before_the_list
Adds content just before de list of buttons (before the <ul>
element):
<?php
if( !function_exists('content_before_jsps_list')) {
function content_before_jsps_list() {
return '<p class="info">(open in a new window)</p>';
}
}
add_filter('juiz_sps_before_the_list', 'content_before_jsps_list');
?>
juiz_sps_after_the_list
Adds content just after de list of buttons (after the <ul>
element):
<?php
if( !function_exists('content_after_jsps_list')) {
function content_after_jsps_list() {
return '<p class="info">Thank you for sharing!</p>';
}
}
add_filter('juiz_sps_after_the_list', 'content_after_jsps_list');
?>
juiz_sps_before_first_item
Adds content just before the first item of the list (before the first <li>
):
<?php
if( !function_exists('content_before_jsps_first_item')) {
function content_before_jsps_first_item() {
return '<li class="juiz_sps_link_myown"><a href="#">MyOwn link</a></li>';
}
}
add_filter('juiz_sps_before_first_item', 'content_before_jsps_first_item');
?>
juiz_sps_after_last_item
Adds content just after the last item of the list (after the last <li>
):
<?php
if( !function_exists('content_after_jsps_last_item')) {
function content_after_jsps_last_item() {
return '<li class="juiz_sps_link_myown"><a href="#">MyOwn link</a></li>';
}
}
add_filter('juiz_sps_after_last_item', 'content_after_jsps_last_item');
?>
juiz_sps_hide_intro_phrase
(since v1.3.0)If you want the remove the introduction sentence of the plugin ("Share the [post-title] article").
<?php
if( !function_exists('hide_the_sps_intro_sentence')) {
function hide_the_sps_intro_sentence() {
return true;
}
}
add_filter('juiz_sps_hide_intro_phrase', 'hide_the_sps_intro_sentence');
?>
juiz_sps_the_permalink
(depreciated) or juiz_sps_the_shared_permalink
(since v1.2.4)Customizes the link shared by users. Be carefull when you customize permalinks, you need a permanent way to find your content ;) (don't create 404 errors)
<?php
if( !function_exists('jsps_custom_permalink')) {
function jsps_custom_permalink($url) {
return $url.'?fromJsps';
}
}
add_filter('juiz_sps_the_shared_permalink', 'jsps_custom_permalink');
?>
juiz_sps_the_shared_permalink_for_[network]
(since v1.2.4)Customizes the link shared by users only for the targeted network. Example for Twitter network:
<?php
if( !function_exists('jsps_custom_permalink_for_twitter')) {
function jsps_custom_permalink($url) {
return $url.'?doWhatYouWant=twitter';
}
}
add_filter('juiz_sps_the_shared_permalink_for_twitter', 'jsps_custom_permalink_for_twitter');
?>
juiz_sps_share_name_for_[network]
(since v1.3.3.7)Customizes the name text for each network by replacing [network] by the good social network's name:
<?php
if( !function_exists('jsps_change_twitter_name')) {
function jsps_change_twitter_name(){
return __('BlueBird');
}
}
add_filter('juiz_sps_share_name_for_twitter', 'jsps_change_twitter_name');
?>
juiz_sps_share_text_for_[network]
(since v1.3.0)Customizes the text inside each tooltip for each network by replacing [network] by the good social network's name:
<?php
if ( ! function_exists('custom_share_text_for_facebook') ) {
function custom_share_text_for_facebook() {
return __('Share my content to your Facebook friends.');
}
}
add_filter('juiz_sps_share_text_for_facebook', 'custom_share_text_for_facebook');
?>
juiz_sps_links_nofollow
By default, links are nofollow-links. If you need to remove this attribute:
<?php
if ( ! function_exists('custom_links_attributes') ) {
function custom_links_attributes() {
return ''; // you can add new attributes instead... just an idea ;)
}
}
add_filter('juiz_sps_links_nofollow', 'custom_links_attributes');
?>
jsps_remove_default_css
(since v1.3.3.7)You need to use your own CSS file, you can remove default CSS files
<?php
if ( ! function_exists('jsps_remove_default_css') ) {
function jsps_remove_default_css(){
return false;
}
}
add_filter('juiz_sps_use_default_css', 'jsps_remove_default_css');
?>
juiz_sps_total_count_word
(since v1.4.1)It's a simple filter to remove or change the "Total:" word next to the total counter.
<?php
if ( ! function_exists('jsps_change_title_word') ) {
function jsps_change_title_word(){
return __('Shares:');
}
}
add_filter('juiz_sps_total_count_word', 'jsps_change_title_word');
?>
juiz_sps_buttons_in_excerpt
(since v1.4.1)Reject or accept buttons in excerpt
<?php
if ( ! function_exists('jsps_accept_button_in_excerpt') ) {
function jsps_accept_button_in_excerpt(){
return true;
}
}
add_filter('juiz_sps_buttons_in_excerpt', 'jsps_accept_button_in_excerpt');
?>
juiz_sps_before_first_item
or juiz_sps_after_last_item
hook in this documentation.
wp_enqueue_style()
, styles of this plugin won't be loaded.