Plugin Directory

Changeset 766263


Ignore:
Timestamp:
09/03/2013 12:33:48 PM (13 years ago)
Author:
TM3909
Message:

2.4 - Fixed js loading issue. Added twitter via option.

Location:
wpsocialite/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wpsocialite/trunk/lib/wpsocialite.css

    r702809 r766263  
    3232.wpsocialite.large .twitter-follow { width: 56px; height: 65px; background-position: -509px 0; }
    3333.wpsocialite.large .twitter-follow.socialite-loaded{ width:100%; }
     34.wpsocialite.large .vkontakte-like { width: 50px; height: 65px; background:red; }
    3435/*
    3536 * Socialite Custom Default
  • wpsocialite/trunk/readme.txt

    r708256 r766263  
    44Tags: social networking, sharing links, lazy loading, lazy loading social links, social links, tm3909, wpinit
    55Requires at least: 3.0
    6 Tested up to: 3.5.1
    7 Stable tag: 2.2
     6Tested up to: 3.6
     7Stable tag: 2.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8989== Changelog ==
    9090
     91= 2.4 September 3, 2013 =
     92* Added twitter via option. Various bug fixes.
     93
    9194= 2.3 May 5, 2013 =
    9295* Fixed image function when using Pinit Button
     
    141144== Upgrade Notice ==
    142145
     146= 2.4 September 3, 2013 =
     147* Added twitter via option. Various bug fixes.
     148
    143149= 2.3 May 5, 2013 =
    144150* Fixed image function when using Pinit Button
  • wpsocialite/trunk/wpsocialite.php

    r708256 r766263  
    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: 2.3
     7Version: 2.4
    88Author URI: http://twmorton.com/
    99
     
    5050            self::$instance = $this;
    5151
    52             add_action(     'init',                     array( $this, 'init'                            ) );
    53             add_action(     'wp_footer',                array( $this, 'wpsocialite_localize_script'     ), 20);
    54 
    55             add_action(     'admin_init',               array( $this, 'admin_init'                      ) );
    56             add_action(     'admin_footer',             array( $this, 'admin_footer'                    ), 20);
    57 
    58             add_filter(     'body_class',               array( $this, 'wpsocialite_body_class'          ) );
    59             add_filter(     'the_content',              array( $this, 'wpsocialite_filter_content'      ) );
    60             add_filter(     'mce_external_plugins',     array( $this, 'wpsocialite_shortcode_plugin'    ) );
    61             add_filter(     'mce_buttons',              array( $this, 'wpsocialite_shortcode_button'    ) );
    62             add_filter(     'plugin_action_links',      array( $this, 'wpsocialite_settings_link'       ), 10, 2 );
    63             add_shortcode(  'wpsocialite',              array( $this, 'wpsocialite_shortcode'           ) );
     52            add_action(     'init',                     array( $this, 'init'                            ) );
     53            add_action(     'wp_footer',                array( $this, 'wpsocialite_localize_script'     ), 20);
     54
     55            add_action(     'admin_init',               array( $this, 'admin_init'                      ) );
     56            add_action(     'admin_footer',             array( $this, 'admin_footer'                    ), 20);
     57
     58            add_filter(     'body_class',               array( $this, 'wpsocialite_body_class'          ) );
     59            add_filter(     'the_content',              array( $this, 'wpsocialite_filter_content'      ) );
     60            add_filter(     'mce_external_plugins',     array( $this, 'wpsocialite_shortcode_plugin'    ) );
     61            add_filter(     'mce_buttons',              array( $this, 'wpsocialite_shortcode_button'    ) );
     62            add_filter(     'plugin_action_links',      array( $this, 'wpsocialite_settings_link'       ), 10, 2 );
     63            add_shortcode(  'wpsocialite',              array( $this, 'wpsocialite_shortcode'           ) );
    6464
    6565            if( get_option( 'wpsocialite_excerpt' ) == 1 ){
    66                 add_filter( 'the_excerpt',              array( $this, 'wpsocialite_filter_content'      ) );
     66                add_filter( 'the_excerpt',              array( $this, 'wpsocialite_filter_content'      ) );
    6767            }
    6868
     
    7575            if( WPSOCIALITE_LOADSCRIPTS && !is_admin() ) {
    7676
    77                 wp_enqueue_script('socialite-lib',  plugin_dir_url(__FILE__).'Socialite/socialite.min.js',  array('jquery'),        '2.0', true);
    78                 wp_enqueue_script('wpsocialite',    plugin_dir_url(__FILE__).'wpsocialite.js',              array('socialite-lib'), '1.0', true);
     77                wp_enqueue_script('socialite-lib',  plugin_dir_url(__FILE__).'Socialite/socialite.min.js',  array('jquery'),        '2.0', true);
     78                wp_enqueue_script('wpsocialite',    plugin_dir_url(__FILE__).'wpsocialite.js',              array('socialite-lib'), '1.0', true);
    7979
    8080                $scripts = self::wpsocialite_list_network_options(null, null, null, null);
     
    8484                foreach ($scripts as $script){
    8585                    if( isset($value[$script['slug']]) && $script['external_file'] !== false )
    86                         wp_enqueue_script('socialite-'.$script['slug'].'', plugin_dir_url(__FILE__).'Socialite/extensions/'.$script['external_file'].'', array('jquery'), '1.0', true);
     86                        wp_enqueue_script('socialite-'.$script['slug'].'', $script['external_file'], array('jquery'), '1.0', true);
    8787                }
    8888
     
    107107
    108108            $locale = get_locale();
    109             $c5     = $locale;
    110             $c2     = substr($c5, 0, 2);
     109            $c5     = $locale;
     110            $c2     = substr($c5, 0, 2);
    111111
    112112            $fb_locales = array('af_ZA','ar_AR','az_AZ','be_BY','bg_BG','bn_IN','bs_BA','ca_ES','cs_CZ','cy_GB','da_DK','de_DE','el_GR','en_GB','en_US','eo_EO','es_ES','es_LA','et_EE','eu_ES','fa_IR','fi_FI','fo_FO','fr_CA','fr_FR','fy_NL','ga_IE','gl_ES','he_IL','hi_IN','hr_HR','hu_HU','hy_AM','id_ID','is_IS','it_IT','ja_JP','ka_GE','km_KH','ko_KR','ku_TR','la_VA','lt_LT','lv_LV','mk_MK','ml_IN','ms_MY','nb_NO','ne_NP','nl_NL','nn_NO','pa_IN','pl_PL','ps_AF','pt_BR','pt_PT','ro_RO','ru_RU','sk_SK','sl_SI','sq_AL','sr_RS','sv_SE','sw_KE','ta_IN','te_IN','th_TH','tl_PH','tr_TR','uk_UA','vi_VN','zh_CN','zh_HK','zh_TW');
     
    118118            $gp_locale = (in_array($c5,$gp_locales))? str_replace('_', '-', $c5) : (in_array($c2,$gp_locales))? $c2 : 'en';
    119119
    120 
    121             echo "<script type=\"text/javascript\">Socialite.setup({facebook:{lang:'$fb_locale',appId:null},twitter:{lang:'$tw_locale'},googleplus:{lang:'$gp_locale'}});</script>";
    122 
     120            if( WPSOCIALITE_LOADSCRIPTS && !is_admin() ) {
     121                echo "<script type=\"text/javascript\">Socialite.setup({facebook:{lang:'$fb_locale',appId:null},twitter:{lang:'$tw_locale'},googleplus:{lang:'$gp_locale'},vkontakte:{apiId:'".get_option('wpsocialite_vkontakte_apiId')."'}});</script>";
     122            }
    123123        }
    124124
     
    143143
    144144            $default_args = array(
    145                 'size'              => get_option('wpsocialite_style'),
    146                 'url'               => null,
    147                 'button_override'   => 'facebook,twitter-share,gplus,linkedin,pinterest,twitter-follow,stumbleupon',
     145                'size'              => get_option('wpsocialite_style'),
     146                'url'               => null,
     147                'button_override'   => 'facebook,twitter-share,gplus,linkedin,pinterest,twitter-follow,stumbleupon,vkontakte-like',
    148148            );
    149149            extract( wp_parse_args($args,$default_args), EXTR_SKIP );
    150150            $button_override = str_replace(' ', '', $button_override);
    151             $button_override = explode(',', esc_attr($button_override));
     151            $button_override = explode(',', esc_attr($button_override));
    152152
    153153            global $wp_query;
    154             $post       = $wp_query->post;
    155             $id         = $post->ID;
    156             $imagelink  = self::wpsocialite_get_image( $id );
    157             $title      = trim($post->post_title);
     154            $post       = $wp_query->post;
     155            $id         = $post->ID;
     156            $imagelink  = self::wpsocialite_get_image( $id );
     157            $title      = trim($post->post_title);
    158158
    159159            if( $url ){
    160                 $postlink   = $url;
     160                $postlink   = $url;
    161161            } else {
    162                 $postlink   = get_permalink($id);
    163             }
    164 
    165             $value      = get_option('wpsocialite_networkoptions');
    166             $buttons    = self::wpsocialite_list_network_options($postlink, $title, $size, $imagelink);
     162                $postlink   = get_permalink($id);
     163            }
     164
     165            $value      = get_option('wpsocialite_networkoptions');
     166            $buttons    = self::wpsocialite_list_network_options($postlink, $title, $size, $imagelink);
    167167
    168168            $return = '<ul class="wpsocialite social-buttons '.$size.'">';
    169169
    170                 foreach ( $buttons as $button ) {
    171 
    172                     if(in_array($button['slug'], $button_override)){
    173 
    174                         if(isset($value[$button['slug']])) :
    175                             $markup = 'markup_'.$size;
    176                         else :
    177                             continue;
    178                         endif;
    179                         $return .= '<li>'.$button[$markup].'</li>';
    180 
    181                     }
    182                 }
    183 
    184             $return     .= '</ul>';
     170                foreach ( $buttons as $button ) {
     171
     172                    if(in_array($button['slug'], $button_override)){
     173
     174                        if(isset($value[$button['slug']])) :
     175                            $markup = 'markup_'.$size;
     176                        else :
     177                            continue;
     178                        endif;
     179                        $return .= '<li>'.$button[$markup].'</li>';
     180
     181                    }
     182                }
     183
     184            $return     .= '</ul>';
    185185
    186186            return $return;
     
    218218            global $wp_current_filter;
    219219
    220             $single     = get_option('wpsocialite_single');
    221             $position   = get_option('wpsocialite_position');
     220            $single     = get_option('wpsocialite_single');
     221            $position   = get_option('wpsocialite_position');
    222222            $post_types = get_option('wpsocialite_post_types',array());
    223             $pt         = get_post_type();
     223            $pt         = get_post_type();
    224224
    225225            if ( $single && !is_singular() ){
     
    233233            if( is_feed() ) {
    234234                return $content;
    235             }
     235            }
    236236
    237237            if( in_array('get_the_excerpt', $wp_current_filter) ) {
    238238                return $content;
    239             }
     239            }
    240240
    241241            switch($position){
     
    263263
    264264            add_settings_section(
    265                 $id         = 'wpsocialite',
    266                 $title      = __('WPSocialite','wpsocialite'),
    267                 $callback   = array($this,'wpsocialite_section'),
    268                 $page       = 'discussion'
    269             );
    270 
    271             add_settings_field(
    272                 $id         = 'wpsocialite_mode',
    273                 $title      = __('Mode','wpsocialite'),
    274                 $callback   = array( $this, 'wpsocialite_select' ),
    275                 $page       = 'discussion',
    276                 $section    = 'wpsocialite',
     265                $id         = 'wpsocialite',
     266                $title      = __('WPSocialite','wpsocialite'),
     267                $callback   = array($this,'wpsocialite_section'),
     268                $page       = 'discussion'
     269            );
     270
     271            add_settings_field(
     272                $id         = 'wpsocialite_mode',
     273                $title      = __('Mode','wpsocialite'),
     274                $callback   = array( $this, 'wpsocialite_select' ),
     275                $page       = 'discussion',
     276                $section    = 'wpsocialite',
    277277                $args       = array(
    278                     'name'        => 'wpsocialite_mode',
    279                     'description' => 'Choose the event to which Socialite will activate.',
    280                     'options'     => array(
    281                         'hover'     => _('Hover'),
    282                         'scroll'    => _('Scroll'),
    283                     ),
    284                 )
    285             );
    286             register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_mode' );
    287 
    288             add_settings_field(
    289                 $id         = 'wpsocialite_excerpt',
    290                 $title      = __('Apply to Excerpt','wpsocialite'),
    291                 $callback   = array( $this, 'wpsocialite_checkbox' ),
    292                 $page       = 'discussion',
    293                 $section    = 'wpsocialite',
    294                 $args       = array(
    295                     'name'        => 'wpsocialite_excerpt',
    296                     'description' => 'Display WPSocialite sharing buttons in the excerpt of your posts.',
    297                     'options'     => array(
    298                         '1' => _('Display WPSocialite sharing buttons in the excerpt of your posts.'),
     278                    'name'        => 'wpsocialite_mode',
     279                    'description' => __('Choose the event to which Socialite will activate.','wpsocialite'),
     280                    'options'     => array(
     281                        'hover'     => __('Hover','wpsocialite'),
     282                        'scroll'    => __('Scroll','wpsocialite'),
    299283                    ),
    300284                )
    301285            );
    302             register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_excerpt' );
    303 
    304             add_settings_field(
    305                 $id         = 'wpsocialite_single',
    306                 $title      = __('Apply to Single only','wpsocialite'),
    307                 $callback   = array( $this, 'wpsocialite_checkbox' ),
    308                 $page       = 'discussion',
    309                 $section    = 'wpsocialite',
     286            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_mode' );
     287
     288            add_settings_field(
     289                $id         = 'wpsocialite_excerpt',
     290                $title      = __('Apply to Excerpt','wpsocialite'),
     291                $callback   = array( $this, 'wpsocialite_checkbox' ),
     292                $page       = 'discussion',
     293                $section    = 'wpsocialite',
    310294                $args       = array(
    311                     'name'        => 'wpsocialite_single',
    312                     'description' => '',
    313                     'options'     => array(
    314                         '1' => _('Display WPSocialite sharing buttons only on single posts.'),
    315                     ),
    316                 )
    317             );
    318             register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_single' );
    319 
    320             add_settings_field(
    321                 $id         = 'wpsocialite_style',
    322                 $title      = __('Style','wpsocialite'),
    323                 $callback   = array( $this, 'wpsocialite_select' ),
    324                 $page       = 'discussion',
    325                 $section    = 'wpsocialite',
    326                 $args       = array(
    327                     'name'        => 'wpsocialite_style',
    328                     'description' => 'Choose the type of socialite style you would like to use.',
    329                     'options'     => array(
    330                         'large' => _('Large'),
    331                         'small' => _('Small'),
     295                    'name'        => 'wpsocialite_excerpt',
     296                    'description' => 'Display WPSocialite sharing buttons in the excerpt of your posts.',
     297                    'options'     => array(
     298                        '1' => __('Display WPSocialite sharing buttons in the excerpt of your posts.','wpsocialite'),
    332299                    ),
    333300                )
    334301            );
    335             register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_style' );
    336 
    337             add_settings_field(
    338                 $id         = 'wpsocialite_position',
    339                 $title      = __('Position','wpsocialite'),
    340                 $callback   = array( $this, 'wpsocialite_select' ),
    341                 $page       = 'discussion',
    342                 $section    = 'wpsocialite',
     302            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_excerpt' );
     303
     304            add_settings_field(
     305                $id         = 'wpsocialite_single',
     306                $title      = __('Apply to Single only','wpsocialite'),
     307                $callback   = array( $this, 'wpsocialite_checkbox' ),
     308                $page       = 'discussion',
     309                $section    = 'wpsocialite',
    343310                $args       = array(
    344                     'name'        => 'wpsocialite_position',
    345                     'description' => sprintf(__('Choose where you would like the social icons to appear, before or after the main content. If set to <strong>Manual</strong>, you can use this code to place your Social links anywhere you like in your templates files: %s','wplazyspotify'),'<pre>&lt;?php wpsocialite_markup(); ?&gt;</pre>'),
    346                     'options'     => array(
    347                         'before'    => _('Top'),
    348                         'after'     => _('Bottom'),
    349                         'both'      => _('Top and Bottom'),
    350                         'manual'    => _('Manual'),
     311                    'name'        => 'wpsocialite_single',
     312                    'description' => '',
     313                    'options'     => array(
     314                        '1' => __('Display WPSocialite sharing buttons only on single posts.','wpsocialite'),
    351315                    ),
    352316                )
    353317            );
    354             register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_position' );
    355 
    356             add_settings_field(
    357                 $id         = 'wpsocialite_post_types',
    358                 $title      = __('Post Types','wpsocialite'),
    359                 $callback   = array( $this, 'wpsocialite_post_types' ),
    360                 $page       = 'discussion',
    361                 $section    = 'wpsocialite'
    362             );
    363             register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_post_types' );
    364 
    365             add_settings_field(
    366                 $id         = 'wpsocialite_networkoptions',
    367                 $title      = __('Network Options','wpsocialite'),
    368                 $callback   = array( $this, 'wpsocialite_networkoptions' ),
    369                 $page       = 'discussion',
    370                 $section    = 'wpsocialite'
    371             );
    372             register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_networkoptions' );
    373 
    374             add_settings_field(
    375                 $id         = 'wpsocialite_twitter_username',
    376                 $title      = __('Twitter Username','wpsocialite'),
    377                 $callback   = array( $this, 'wpsocialite_text_input' ),
    378                 $page       = 'discussion',
    379                 $section    = 'wpsocialite',
     318            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_single' );
     319
     320            add_settings_field(
     321                $id         = 'wpsocialite_style',
     322                $title      = __('Style','wpsocialite'),
     323                $callback   = array( $this, 'wpsocialite_select' ),
     324                $page       = 'discussion',
     325                $section    = 'wpsocialite',
    380326                $args       = array(
    381                     'name'        => 'wpsocialite_twitter_username',
    382                     'description' => 'Enter your twitter username to enable the twitter follow button.',
    383                     'options'     => array(
    384                         'twitter_username'  => _(''),
     327                    'name'        => 'wpsocialite_style',
     328                    'description' => __('Choose the type of socialite style you would like to use.','wpsocialite'),
     329                    'options'     => array(
     330                        'large' => __('Large','wpsocialite'),
     331                        'small' => __('Small','wpsocialite'),
    385332                    ),
    386333                )
    387334            );
     335            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_style' );
     336
     337            add_settings_field(
     338                $id         = 'wpsocialite_position',
     339                $title      = __('Position','wpsocialite'),
     340                $callback   = array( $this, 'wpsocialite_select' ),
     341                $page       = 'discussion',
     342                $section    = 'wpsocialite',
     343                $args       = array(
     344                    'name'        => 'wpsocialite_position',
     345                    'description' => sprintf(__('Choose where you would like the social icons to appear, before or after the main content. If set to <strong>Manual</strong>, you can use this code to place your Social links anywhere you like in your templates files: %s','wpsocialite'),'<pre>&lt;?php wpsocialite_markup(); ?&gt;</pre>'),
     346                    'options'     => array(
     347                        'before'    => __('Top','wpsocialite'),
     348                        'after'     => __('Bottom','wpsocialite'),
     349                        'both'      => __('Top and Bottom','wpsocialite'),
     350                        'manual'    => __('Manual','wpsocialite'),
     351                    ),
     352                )
     353            );
     354            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_position' );
     355
     356            add_settings_field(
     357                $id         = 'wpsocialite_post_types',
     358                $title      = __('Post Types','wpsocialite'),
     359                $callback   = array( $this, 'wpsocialite_post_types' ),
     360                $page       = 'discussion',
     361                $section    = 'wpsocialite'
     362            );
     363            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_post_types' );
     364
     365            add_settings_field(
     366                $id         = 'wpsocialite_networkoptions',
     367                $title      = __('Network Options','wpsocialite'),
     368                $callback   = array( $this, 'wpsocialite_networkoptions' ),
     369                $page       = 'discussion',
     370                $section    = 'wpsocialite'
     371            );
     372            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_networkoptions' );
     373
     374            add_settings_field(
     375                $id         = 'wpsocialite_twitter_username',
     376                $title      = __('Twitter Username','wpsocialite'),
     377                $callback   = array( $this, 'wpsocialite_text_input' ),
     378                $page       = 'discussion',
     379                $section    = 'wpsocialite',
     380                $args       = array(
     381                    'name'        => 'wpsocialite_twitter_username',
     382                    'description' => 'Enter your twitter username to enable the twitter follow button.',
     383                    'options'     => array(
     384                        'twitter_username'  => __(''),
     385                    ),
     386                )
     387            );
    388388            register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_twitter_username' );
    389389
     
    391391
    392392        public function admin_footer() {
    393             echo '<script type="text/javascript">
    394                 jQuery(document).ready(function($) {
    395                     var twitterusername = $("#wpsocialite_twitter_username").closest("tr");
    396                     var twitterfollow = $("input:checkbox[name=\'wpsocialite_networkoptions[twitter-follow]\']");
    397                     twitterusername.hide();
    398 
    399                     if( twitterfollow.is(":checked") ){
    400                         twitterusername.show();
    401                     }
    402                     twitterfollow.on(\'change\', function() {
    403                         if(twitterfollow.is(":checked")){
    404                             twitterusername.show();
    405                         } else {
    406                             twitterusername.hide();
    407                         }
    408                     });
    409                 });
    410             </script>';
     393            echo '<script type="text/javascript">
     394                jQuery(document).ready(function($) {
     395                    var twitterusername = $("#wpsocialite_twitter_username").closest("tr");
     396                    var twitterfollow = $("input:checkbox[name=\'wpsocialite_networkoptions[twitter-follow]\']");
     397                    twitterusername.hide();
     398
     399                    if( twitterfollow.is(":checked") ){
     400                        twitterusername.show();
     401                    }
     402                    twitterfollow.on(\'change\', function() {
     403                        if(twitterfollow.is(":checked")){
     404                            twitterusername.show();
     405                        } else {
     406                            twitterusername.hide();
     407                        }
     408                    });
     409
     410                    var vkontakte_appid_input = $("#wpsocialite_vkontakte_apiId").closest("tr");
     411                    var vkontaktelike = $("input:checkbox[name=\'wpsocialite_networkoptions[vkontakte-like]\']");
     412                    vkontakte_appid_input.hide();
     413
     414                    if( vkontaktelike.is(":checked") ){
     415                        vkontakte_appid_input.show();
     416                    }
     417                    vkontaktelike.on(\'change\', function() {
     418                        if(vkontaktelike.is(":checked")){
     419                            vkontakte_appid_input.show();
     420                        } else {
     421                            vkontakte_appid_input.hide();
     422                        }
     423                    });
     424                });
     425            </script>';
    411426        }
    412427
     
    437452            $checked = ( isset( $args['name'] ) ) ? get_option($args['name']) : '';
    438453            echo '<label for="' . esc_attr( $args['name'] ) . '">';
    439                 foreach ( (array) $args['options'] as $value => $label ){
     454                foreach ( (array) $args['options'] as $value => $label ){
    440455                    echo '<input name="' . esc_attr( $args['name'] ) . '" type="checkbox" id="' . esc_attr( $args['name'] ) . '" value="1"  '.checked($checked, 1, false).'> ' . $label;
    441                 }
     456                }
    442457            echo '</label>';
    443458
     
    452467
    453468            echo '<label for="' . esc_attr( $args['name'] ) . '">';
    454                 foreach ( (array) $args['options'] as $value => $label ){
     469                foreach ( (array) $args['options'] as $value => $label ){
    455470                    echo '<input name="' . esc_attr( $args['name'] ) . '" type="text" id="' . esc_attr( $args['name'] ) . '" value="'.esc_attr($option_value).'" > ' . $label;
    456                 }
     471                }
    457472            echo '</label>';
     473            if ( ! empty( $args['description'] ) )
     474                echo ' <p class="description">' . $args['description'] . '</p>';
    458475
    459476        }
     
    480497        public function wpsocialite_networkoptions() {
    481498
    482             $value      = get_option('wpsocialite_networkoptions');
    483             $buttons    = $this->wpsocialite_list_network_options();
    484             $output     = '';
     499            $value      = get_option('wpsocialite_networkoptions');
     500            $buttons    = $this->wpsocialite_list_network_options();
     501            $output     = '';
    485502
    486503            foreach ($buttons as $button){
     
    516533            $buttons = array(
    517534                'facebook' => array(
    518                     'name' => 'Facebook',
     535                    'name' => __('Facebook','wpsocialite'),
    519536                    'slug' => 'facebook',
    520537                    'markup_large' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&amp;locale='.$locale.'&amp;t='.$title.'" class="socialite facebook-like" data-lang="'.$locale.'" data-href="'.$link.'" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_facebook_label',__('Share on Facebook.','wpsocialite')).'</span></a>',
     
    523540                ),
    524541                'twitter-share' => array(
    525                     'name' => 'Twitter Share',
     542                    'name' => __('Twitter Share','wpsocialite'),
    526543                    'slug' => 'twitter-share',
    527                     'markup_large' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$twitter_title.'" data-url="'.$link.'" data-count="vertical" data-lang="'.$locale.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>',
    528                     'markup_small' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$twitter_title.'" data-url="'.$link.'" data-count="horizontal" data-lang="'.$locale.'" data-via="" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>',
     544                    'markup_large' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$twitter_title.'" data-url="'.$link.'" data-count="vertical" data-lang="'.$locale.'" data-via="'.$twitter_username.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>',
     545                    'markup_small' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$twitter_title.'" data-url="'.$link.'" data-count="horizontal" data-lang="'.$locale.'" data-via="'.$twitter_username.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>',
    529546                    'external_file' => false
    530547                ),
    531548                'gplus' => array(
    532                     'name' => 'Google Plus',
     549                    'name' => __('Google Plus','wpsocialite'),
    533550                    'slug' => 'gplus',
    534551                    'markup_large' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="tall" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_googleplus_label',__('Share on Google+','wpsocialite')).'</span></a>',
     
    537554                ),
    538555                'linkedin' => array(
    539                     'name' => 'Linkedin',
     556                    'name' => __('Linkedin','wpsocialite'),
    540557                    'slug' => 'linkedin',
    541558                    'markup_large' => '<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url='.$link.'&amp;title='.$title.'" class="socialite linkedin-share" data-url="'.$link.'" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_linkedin_label',__('Share on LinkedIn','wpsocialite')).'</span></a>',
     
    544561                ),
    545562                'pinterest' => array(
    546                     'name' => 'Pinterest',
     563                    'name' => __('Pinterest','wpsocialite'),
    547564                    'slug' => 'pinterest',
    548565                    'markup_large' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&amp;media=' . $image . '&amp;description='.$title.'" class="socialite pinterest-pinit" data-count-layout="vertical"><span class="vhidden">'.apply_filters('wpsocialite_share_pinterest_label',__('Pin It!','wpsocialite')).'</span></a>',
    549566                    'markup_small' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&amp;media=' . $image . '&amp;description='.$title.'" class="socialite pinterest-pinit" data-count-layout="horizontal"><span class="vhidden">'.apply_filters('wpsocialite_share_pinterest_label',__('Pin It!','wpsocialite')).'</span></a>',
    550                     'external_file' => 'socialite.pinterest.js'
     567                    'external_file' => plugin_dir_url(__FILE__).'Socialite/extensions/socialite.pinterest.js',
     568
    551569                ),
    552570                'stumbleupon' => array(
    553                     'name' => 'StumbleUpon',
     571                    'name' => __('StumbleUpon','wpsocialite'),
    554572                    'slug' => 'stumbleupon',
    555573                    'markup_large' => '<a href="http://www.stumbleupon.com/submit?url='.$link.'&amp;title='.$title.'" class="socialite stumbleupon-share" data-url="'.$link.'" data-title="'.$title.'" data-layout="5" rel="nofollow"><span class="vhidden">'.apply_filters('wpsocialite_share_stumbleupon_label',__('Share on StumbleUpon','wpsocialite')).'</span></a>',
    556574                    'markup_small' => '<a href="http://www.stumbleupon.com/submit?url='.$link.'&amp;title='.$title.'" class="socialite stumbleupon-share" data-url="'.$link.'" data-title="'.$title.'" data-layout="1" rel="nofollow"><span class="vhidden">'.apply_filters('wpsocialite_share_stumbleupon_label',__('Share on StumbleUpon','wpsocialite')).'</span></a>',
    557                     'external_file' => 'socialite.stumbleupon.js'
     575                    'external_file' => plugin_dir_url(__FILE__).'Socialite/extensions/socialite.stumbleupon.js',
    558576                ),
    559577                'twitter-follow' => array(
    560                     'name' => 'Twitter Follow',
     578                    'name' => __('Twitter Follow','wpsocialite'),
    561579                    'slug' => 'twitter-follow',
    562580                    'markup_large' => '<a href="http://twitter.com/'.$twitter_username.'" class="socialite twitter-follow" data-text="'.$twitter_title.'" data-url="'.$link.'" data-size="large" data-width="" data-lang="'.$locale.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>',
    563581                    'markup_small' => '<a href="http://twitter.com/'.$twitter_username.'" class="socialite twitter-follow" data-text="'.$twitter_title.'" data-url="'.$link.'" data-size="small" data-lang="'.$locale.'" data-via="" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>',
    564582                    'external_file' => false
    565                 ),
     583                )
    566584            );
    567585
Note: See TracChangeset for help on using the changeset viewer.