WordPress.org

Plugin Directory

Changeset 1711555


Ignore:
Timestamp:
08/10/17 14:06:21 (6 months ago)
Author:
mimothemes
Message:

Small css fixes

Location:
mimo-social/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • mimo-social/trunk/README.txt

    r1538320 r1711555  
    44Tags: social,share,share buttons, share content, shares count, share count, likes count, twitter, facebook, google plus, pinterest, social share plugin, social share wordpress, social share easy, easu social share, social count, facebook count, twitter count, google plus count, pinterest count 
    55Requires at least: 4.5.3 
    6 Tested up to: 4.5.3 
    7 Stable tag: 1.1 
     6Tested up to: 4.7 
     7Stable tag: 4.7 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
  • mimo-social/trunk/includes/class-mimo-social.php

    r1535762 r1711555  
    185185        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); 
    186186        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); 
    187         $this->loader->add_filter( 'the_content',  $plugin_public,'filter_the_content' ); 
     187         
    188188 
    189189    } 
  • mimo-social/trunk/mimo-social.php

    r1535762 r1711555  
    1111 * Plugin URI:        http://mimo.studio 
    1212 * Description:       Create custom share bar with your favorite social networks. 
    13  * Version:           1.1.0 
     13 * Version:           1.2.0 
    1414 * Author:            mimothemes 
    1515 * Author URI:        http://mimo.studio 
     
    4545register_activation_hook( __FILE__, 'activate_mimo_social' ); 
    4646register_deactivation_hook( __FILE__, 'deactivate_mimo_social' ); 
     47add_filter( 'the_content', 'mimo_social_filter_the_content' , 10 ); 
    4748 
     49function mimo_social_filter_the_content( $content ) { 
     50    $general_settings = get_option( 'mimo_social_settings' ); 
     51     
     52    $mimo_social_settings_where = isset($general_settings['mimo_social_where']) ? $general_settings['mimo_social_where'] : NULL; 
     53    $top_content = ''; 
     54    $custom_content = $content; 
     55    $bottom_content = ''; 
     56 
     57    if(is_single() && $mimo_social_settings_where && in_array('top', $mimo_social_settings_where ) == true  ) { 
     58    $top_content = '[mimo_social class="mimo-social-top"]'; 
     59     
     60     
     61    } 
     62 
     63    if(is_single() && $mimo_social_settings_where && in_array('bottom', $mimo_social_settings_where ) == true ) { 
     64     
     65    $bottom_content = '[mimo_social class="mimo-social-bottom"]'; 
     66     
     67    } 
     68 
     69    $all_content = $top_content; 
     70    $all_content .= $custom_content; 
     71    $all_content .= $bottom_content; 
     72 
     73    return $all_content; 
     74} 
    4875/** 
    4976 * The core plugin class that is used to define internationalization, 
  • mimo-social/trunk/public/class-mimo-social-public.php

    r1535762 r1711555  
    5757    } 
    5858 
    59     public function get_shares_count($network){ 
     59    public static function get_shares_count($network){ 
    6060 
    6161          
     
    127127    } 
    128128 
    129     public function filter_the_content( $content ) { 
    130         $general_settings = get_option( 'mimo_social_settings' ); 
    131          
    132         $mimo_social_settings_where = $general_settings['mimo_social_where']; 
    133         $top_content = ''; 
    134         $custom_content = $content; 
    135         $bottom_content = ''; 
    136  
    137         if(is_singular() && $mimo_social_settings_where && in_array('top', $mimo_social_settings_where ) == true  ) { 
    138         $top_content = '[mimo_social]'; 
    139          
    140          
    141         } 
    142  
    143         if(is_singular() && $mimo_social_settings_where && in_array('bottom', $mimo_social_settings_where ) == true ) { 
    144          
    145         $bottom_content = '[mimo_social]'; 
    146          
    147         } 
    148  
    149         $all_content = $top_content; 
    150         $all_content .= $custom_content; 
    151         $all_content .= $bottom_content; 
    152  
    153         return $all_content; 
    154     } 
    155129     
    156  
    157     public function display_share_buttons(){ 
     130     
     131 
     132    public static function display_share_buttons($the_class = 'mimo-social-share-buttons'){ 
    158133        $general_settings = get_option( 'mimo_social_settings' ); 
    159134        $actual_link = get_permalink(get_the_id() );; 
    160135         
    161         $mimo_social_settings_activated = $general_settings['mimo_social_activated']; 
    162  
    163         $mimo_social_settings_where = $general_settings['mimo_social_where']; 
    164  
    165         echo '<div class="mimo-social-shares btn-group">'; 
    166  
    167         if(in_array('facebook', $mimo_social_settings_activated ) == true ) { 
    168  
    169             $fshares_count = self::get_shares_count('facebook'); 
    170  
    171             echo '<a class="btn-facebook btn btn-mimo-social  btn-secondary" href="https://www.facebook.com/sharer.php?u=' .  $actual_link .'" target="_blank"><i class="fa fa-facebook">' . $fshares_count . '</i></a>'; 
    172  
    173         } 
    174  
    175         if(in_array('twitter', $mimo_social_settings_activated ) == true ) { 
    176  
    177             $tshares_count = self::get_shares_count('twitter'); 
    178  
    179             echo '<a class="btn-twitter btn btn-mimo-social  btn-secondary" href="https://twitter.com/intent/tweet?url=' .  $actual_link .'" target="_blank"><i class="fa fa-twitter">' . $tshares_count . '</i></a>'; 
    180  
    181         } 
    182  
    183         if(in_array('google', $mimo_social_settings_activated ) == true ) { 
    184  
    185             $gshares_count = self::get_shares_count('google'); 
    186  
    187             echo '<a class="btn-google btn btn-mimo-social btn-secondary" href="https://plus.google.com/share?url=' .  $actual_link .'" target="_blank"><i class="fa fa-google-plus">' . $gshares_count . '</i></a>'; 
    188  
    189         } 
    190  
    191         if(in_array('pinterest', $mimo_social_settings_activated ) == true ) { 
    192  
    193             $pshares_count = self::get_shares_count('pinterest'); 
    194  
    195             echo '<a class="btn-pinterest btn btn-mimo-social  btn-secondary" href="https://pinterest.com/pin/create/bookmarklet/?url=' .  $actual_link .'" target="_blank"><i class="fa fa-pinterest">' . $pshares_count . '</i></a>'; 
    196  
    197         } 
    198  
    199         echo '</div>'; 
     136        $mimo_social_settings_activated = isset($general_settings['mimo_social_activated']) ? $general_settings['mimo_social_activated'] : NULL; 
     137        $mimo_social_settings_where = isset($general_settings['mimo_social_where']) ? $general_settings['mimo_social_where'] : NULL; 
     138        if ( NULL !== $mimo_social_settings_activated ) : 
     139            echo '<div class="mimo-social-shares btn-group ' . esc_attr($the_class) . '">'; 
     140 
     141            if(in_array('facebook', $mimo_social_settings_activated ) == true ) { 
     142 
     143                $fshares_count = self::get_shares_count('facebook'); 
     144 
     145                echo '<a class="btn-facebook btn btn-mimo-social  btn-secondary" href="https://www.facebook.com/sharer.php?u=' .  $actual_link .'" target="_blank"><i class="fa fa-facebook">' . $fshares_count . '</i></a>'; 
     146 
     147            } 
     148 
     149            if(in_array('twitter', $mimo_social_settings_activated ) == true ) { 
     150 
     151                $tshares_count = self::get_shares_count('twitter'); 
     152 
     153                echo '<a class="btn-twitter btn btn-mimo-social  btn-secondary" href="https://twitter.com/intent/tweet?url=' .  $actual_link .'" target="_blank"><i class="fa fa-twitter">' . $tshares_count . '</i></a>'; 
     154 
     155            } 
     156 
     157            if(in_array('google', $mimo_social_settings_activated ) == true ) { 
     158 
     159                $gshares_count = self::get_shares_count('google'); 
     160 
     161                echo '<a class="btn-google btn btn-mimo-social btn-secondary" href="https://plus.google.com/share?url=' .  $actual_link .'" target="_blank"><i class="fa fa-google-plus">' . $gshares_count . '</i></a>'; 
     162 
     163            } 
     164 
     165            if(in_array('pinterest', $mimo_social_settings_activated ) == true ) { 
     166 
     167                $pshares_count = self::get_shares_count('pinterest'); 
     168 
     169                echo '<a class="btn-pinterest btn btn-mimo-social  btn-secondary" href="https://pinterest.com/pin/create/bookmarklet/?url=' .  $actual_link .'" target="_blank"><i class="fa fa-pinterest">' . $pshares_count . '</i></a>'; 
     170 
     171            } 
     172 
     173 
     174 
     175            echo '</div>'; 
     176        endif; 
    200177 
    201178         
     
    217194        $mimo_social_settings_activated = $general_settings['mimo_social_activated']; 
    218195 
    219         $mimo_social_settings_where = $general_settings['mimo_social_where']; 
    220  
    221         echo '<div class="mimo-social-links btn-group">'; 
     196        $mimo_social_settings_where = isset($general_settings['mimo_social_where']) ? $general_settings['mimo_social_where'] : NULL; 
     197 
     198        echo '<div class="mimo-social-links">'; 
    222199 
    223200        if(in_array('facebook', $mimo_social_settings_activated ) == true  && $mimo_social_facebook_url !== null ) { 
     
    391368        // Shortcode that shows the social buttons 
    392369         
    393          extract( shortcode_atts( array( 
     370         $atts = shortcode_atts( array( 
    394371 
    395372            'id' => '', 
    396  
    397         ) , $atts ) ); 
     373            'class' => 'mimo-social-share-buttons' 
     374 
     375        ) , $atts ); 
    398376 
    399377         $args = array(); 
     
    403381    // Parse incoming $args into an array and merge it with $defaults 
    404382        $args = wp_parse_args( $atts ); 
    405  
     383        $class = $args['class']; 
    406384             
    407385             ob_start(); 
    408     self::display_share_buttons(); 
     386    self::display_share_buttons($class); 
    409387     $output = ob_get_clean(); 
    410388     //print $output; // debug 
     
    416394        // Shortcode that shows the social buttons 
    417395         
    418          extract( shortcode_atts( array( 
     396        extract( shortcode_atts( array( 
    419397 
    420398            'id' => '', 
     
    422400        ) , $atts ) ); 
    423401 
    424          $args = array(); 
     402        $args = array(); 
    425403 
    426404 
    427405     
    428     // Parse incoming $args into an array and merge it with $defaults 
     406        // Parse incoming $args into an array and merge it with $defaults 
    429407        $args = wp_parse_args( $atts ); 
    430408 
    431409             
    432              ob_start(); 
    433     self::display_count_buttons(); 
    434      $output = ob_get_clean(); 
    435      //print $output; // debug 
    436      return $output; 
     410        ob_start(); 
     411        self::display_count_buttons(); 
     412        $output = ob_get_clean(); 
     413        return $output; 
    437414 
    438415    } 
  • mimo-social/trunk/public/css/mimo-social-public.css

    r1535762 r1711555  
    1818 } 
    1919 
    20  a.btn.btn-facebook.btn-facebook:hover { 
     20 a.btn.btn-facebook.btn-secondary:hover { 
    2121    background: #3b5998; 
    2222 } 
    2323 
    24  a.btn.btn-twitter:hover { 
     24 a.btn.btn-twitter.btn-secondary:hover { 
    2525    background: #55acee; 
    2626 } 
    2727 
    28  a.btn.btn-google:hover { 
     28 a.btn.btn-google.btn-secondary:hover { 
    2929    background: #dd4b39; 
    3030 } 
    3131 
    32  a.btn.btn-pinterest:hover { 
     32 a.btn.btn-pinterest.btn-secondary:hover { 
    3333    background: #cb2027; 
    3434 } 
    3535 
    36  a.btn.btn-youtube:hover { 
     36 a.btn.btn-youtube.btn-secondary:hover { 
    3737    background: #dd4b39; 
    3838 } 
    3939 
    40  a.btn.btn-instagram:hover { 
     40 a.btn.btn-instagram.btn-secondary:hover { 
    4141    background: #cd486b; 
    4242 } 
Note: See TracChangeset for help on using the changeset viewer.