Plugin Directory

Changeset 643086


Ignore:
Timestamp:
12/21/2012 07:47:16 PM (13 years ago)
Author:
TM3909
Message:

Adding shortcode for WPSocialite.

Location:
wpsocialite/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • wpsocialite/trunk/readme.txt

    r640073 r643086  
    44Tags: social networking, sharing links, lazy loading, lazy loading social links, social links, tm3909
    55Requires at least: 3.0
    6 Tested up to: 3.4.2
    7 Stable tag: 1.4.5
     6Tested up to: 3.5
     7Stable tag: 1.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050When using this method, be sure to include "large" or "small" inside the function (as seen above) to define which style WPSocialite will use to display your social links.
    5151
     52You can also use the shortcode `[wpsocialite size="large"]` or `[wpsocialite size="small"]` in a post or page and it will display the social sharing buttons anywhere you like.
     53
    5254= Can I disable the plugins script loading in order to manually add the CSS and Javascript myself? =
    5355
     
    7375
    7476== Changelog ==
     77
     78= 1.5 =
     79* Adding shortcode option to display WpSocialite
    7580
    7681= 1.4.5 =
     
    108113== Upgrade Notice ==
    109114
     115= 1.5 =
     116* Adding shortcode option to display WpSocialite
     117
    110118= 1.4.5 =
    111119* Fixed in_array error being thrown due to post type check.
  • wpsocialite/trunk/wpsocialite.php

    r640073 r643086  
    55Description: No one likes long load times! Yet we all want to be able to share our content via Facebook, Twitter, and all other social networks. These take a long time to load. Paradox? Not anymore! With WPSocialite (utilizing David Bushnell's amazing SocialiteJS plugin [http://www.socialitejs.com/]) we can manage the loading process of our social sharing links. Load them on hover, on page scroll, and more!
    66Author: Tom Morton
    7 Version: 1.4.5
     7Version: 1.5
    88Author URI: http://twmorton.com/
    99
     
    6666            }
    6767
     68            add_shortcode( 'wpsocialite', array( &$this, 'wpsocialite_shortcode' ));
     69            add_filter('mce_external_plugins', array( &$this, 'wpsocialite_shortcode_plugin' ));
     70            add_filter('mce_buttons', array( &$this, 'wpsocialite_shortcode_button' ));
     71
    6872        } // __construct
    6973
     
    152156        } // wpsocialite_enqueue_scripts
    153157
     158        function wpsocialite_shortcode($atts){
     159            extract( shortcode_atts( array(
     160                'size' => 'small',
     161            ), $atts ) );
     162
     163            return get_wpsocialite_markup($atts);
     164
     165        }
     166
     167        function wpsocialite_shortcode_button($buttons) {
     168            array_push($buttons, "wpsocialite");
     169            return $buttons;
     170        }
     171
     172        function wpsocialite_shortcode_plugin($plugin_array) {
     173            $plugin_array['wpsocialite'] = WPSOCIALITE_URL.'lib/wpsocialite-shortcode.js';
     174            return $plugin_array;
     175        }
    154176
    155177        function wpsocialite_markup($args = array())
Note: See TracChangeset for help on using the changeset viewer.