Plugin Directory

Changeset 849720


Ignore:
Timestamp:
02/02/2014 04:32:41 AM (12 years ago)
Author:
shen045
Message:

Updated to version 1.0.8: Added support for WordPress MultiSite

Location:
crafty-social-buttons/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • crafty-social-buttons/trunk/README.txt

    r831973 r849720  
    9191== Changelog ==
    9292
     93= 1.0.8 =
     94* Enabled support for WordPress MultiSite
     95
    9396= 1.0.6 =
    9497* Fixed bug with headers not sent
     
    116119
    117120== Upgrade Notice ==
     121
     122= 1.0.8 =
     123* Enables WordPress MultiSite
    118124
    119125= 1.0.6 =
  • crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Admin.php

    r828490 r849720  
    99
    1010class SH_Crafty_Social_Buttons_Admin {
    11 
    12     /**
    13      * Plugin version, used for cache-busting of style and script file references.
    14      */
    15     protected $version = '1.0.5';
    1611
    1712    /**
  • crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Plugin.php

    r828490 r849720  
    1313     * Plugin version, used for cache-busting of style and script file references.
    1414     */
    15     protected $version = '1.0.5';
     15    protected $version = '1.0.8';
    1616
    1717    /**
     
    8080     */
    8181    public static function activate( $network_wide ) {
    82        
     82        if (function_exists('is_multisite') && is_multisite() && $network_wide) {
     83            global $wpdb;
     84            $old_blog =  get_current_blog_id();
     85
     86            $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
     87            foreach ($blogids as $blog_id) {
     88                switch_to_blog($blog_id);
     89                self::activate_single_site();
     90            }
     91            switch_to_blog($old_blog);
     92        } else { // activate non-multi-site or single site
     93            self::activate_single_site();   
     94        }
     95    }
     96   
     97    private static function activate_single_site() {
    8398         $settings = get_option("crafty-social-buttons");
    84          if ( false === $settings ) {
     99         if ( !$settings || count($settings) <= 1 ) {
    85100              $settings = self::get_default_settings();
    86101         }
    87          update_option("crafty-social-buttons", $settings );           
     102         update_option("crafty-social-buttons", $settings );               
    88103    }
    89104
  • crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Shortcode.php

    r828490 r849720  
    99
    1010class SH_Crafty_Social_Buttons_Shortcode {
    11 
    12     /**
    13      * Plugin version, used for cache-busting of style and script file references.
    14      */
    15     protected $version = '1.0.5';
    1611
    1712    /**
  • crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Widget.php

    r828490 r849720  
    1010// widget class
    1111class SH_Crafty_Social_Buttons_Widget extends WP_Widget {
    12 
    13     /**
    14      * Plugin version, used for cache-busting of style and script file references.
    15      */
    16     protected $version = '1.0.5';
    1712
    1813    /**
  • crafty-social-buttons/trunk/crafty-social-buttons.php

    r833032 r849720  
    1616 * Plugin URI:  http://github.com/sarahhenderson/crafty-social-buttons
    1717 * Description: Adds social sharing buttons and links to your site, including Ravelry, Etsy, Craftsy and Pinterest
    18  * Version:     1.0.7
     18 * Version:     1.0.8
    1919 * Author:      Sarah Henderson
    2020 * Author URI:  http://sarahhenderson.info
  • crafty-social-buttons/trunk/css/admin.min.css

    r833032 r849720  
    11/*! crafty-social-buttons  (c) Sarah Henderson 2014
    2  * Version 1.0.7 (05-01-2014) */
     2 * Version 1.0.8 (02-02-2014) */
    33
    44.crafty-social-buttons .csb-include-list{border:1px solid #ddd;background:#f1f1f1;margin-right:.5em;vertical-align:top;padding:.4em}.crafty-social-buttons .include-heading{text-align:left;font-weight:700}.crafty-social-buttons .csb-include-list ul{border:1px solid #ddd;background:#fff;padding:.5em;margin:0;min-height:60px}.crafty-social-buttons .csb-include-list ul li{display:inline-block;padding:0;margin:.3em;text-align:center;font-size:1.2em;cursor:move}.crafty-social-buttons .csb-image-preview{margin-top:.5em}.crafty-social-buttons select{width:200px}.crafty-social-buttons input[type=text]{width:350px}.crafty-social-buttons span.description{font-style:normal}.crafty-social-buttons span.description strong{font-style:italic}
  • crafty-social-buttons/trunk/css/public.min.css

    r833032 r849720  
    11/*! crafty-social-buttons  (c) Sarah Henderson 2014
    2  * Version 1.0.7 (05-01-2014) */
     2 * Version 1.0.8 (02-02-2014) */
    33
    44.crafty-social-buttons{margin:.3em 0}.crafty-social-buttons .crafty-social-caption{display:inline-block;padding-right:1em;vertical-align:top;font-size:1.2em}.crafty-social-buttons .size48 img,.crafty-social-buttons img{max-width:48px;max-height:48px}.crafty-social-buttons .size16 img{max-width:16px;max-height:16px}.crafty-social-buttons .size32 img{max-width:32px;max-height:32px}.crafty-social-buttons .size64 img{max-width:64px;max-height:64px}.crafty-social-buttons ul{display:inline-block;list-style-type:none;margin:0;padding:0}.crafty-social-buttons ul li{display:inline-block;margin:0 .2em;padding:0}.crafty-social-buttons .crafty-social-share-count:after,.crafty-social-buttons .crafty-social-share-count:before{right:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.crafty-social-buttons .crafty-social-share-count:after{border-color:rgba(224,221,221,0);border-right-color:#f5f5f5;border-width:5px;top:50%;margin-top:-5px}.crafty-social-buttons .crafty-social-share-count:before{border-color:rgba(85,94,88,0);border-right-color:#e0dddd;border-width:6px;top:50%;margin-top:-6px}.crafty-social-buttons .crafty-social-share-count{font:11px Arial,Helvetica,sans-serif;color:#555e58;padding:5px;-khtml-border-radius:6px;-o-border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;position:relative;background:#f5f5f5;border:1px solid #e0dddd}
  • crafty-social-buttons/trunk/js/admin.min.js

    r833032 r849720  
    11/*! crafty-social-buttons  (c) Sarah Henderson 2014
    2  * Version 1.0.7 (05-01-2014) */
     2 * Version 1.0.8 (02-02-2014) */
    33jQuery(document).ready(function(a){a("#csbsort1, #csbsort2").sortable({connectWith:".connectedSortable",update:function(){var b=a("#csbsort2 li").map(function(){return a(this).attr("id")}).get();a(".csb-services").val(b)}}).disableSelection(),a(".csb-services").val(a("#csbsort2 li").map(function(){return a(this).attr("id")}).get()),a(".csb-image-set").change(function(){var b=a(this).val();a(".csb-image-preview").attr("data-base"),a.each(a(".csb-services img"),function(c,d){var e=a(d).attr("src"),f=a(d).attr("data-image-set"),g=e.replace(f,b);0,a(d).attr("src",g),a(d).attr("data-image-set",b)})})});
  • crafty-social-buttons/trunk/services/class-SH_Facebook.php

    r833032 r849720  
    1919    public function shareButton($url, $title = '', $showCount = false) {
    2020       
    21         $html = '<a class="' . $this->cssClass() . '" href="http://www.facebook.com/sharer.php?'
     21        $html = '<a class="' . $this->cssClass() . '" href="http://www.facebook.com/sharer/sharer.php?'
    2222             . 'u=' . $url. '" '
    2323             . ($this->newWindow ? 'target="_blank"' : '') . '>';
  • crafty-social-buttons/trunk/uninstall.php

    r801913 r849720  
    33 * Fired when the plugin is uninstalled.
    44 *
    5  * @package   Plugin_Name
    6  * @author    Your Name <[email protected]>
    7  * @license   GPL-2.0+
    8  * @link      http://example.com
    9  * @copyright 2013 Your Name or Company Name
     5 * @package   Crafty Social Buttons
     6 * @author    Sarah Henderson <[email protected]>
    107 */
    118
     
    1512}
    1613
     14$settings_option = "crafty-social-buttons";
     15$widget_option = "widget_crafty-social-buttons_widget";
    1716
    18 // delete all options
    19 delete_option( "crafty-social-buttons" );
    20 delete_option( "widget_crafty-social-buttons_widget" );
    21    
     17
     18if ( !is_multisite() )
     19{
     20    // delete all options
     21    delete_option( $settings_option );
     22    delete_option( $widget_option );
     23}
     24else
     25{
     26    global $wpdb;
     27    $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
     28    $original_blog_id = get_current_blog_id();
     29
     30    foreach ( $blog_ids as $blog_id )
     31    {
     32        switch_to_blog( $blog_id );
     33        delete_option( $settings_option );
     34        delete_option( $widget_option );
     35    }
     36    switch_to_blog( $original_blog_id );
     37}
Note: See TracChangeset for help on using the changeset viewer.