Changeset 2110263
- Timestamp:
- 06/21/2019 04:34:33 PM (7 years ago)
- Location:
- social-sharing-buttons-and-counters/trunk
- Files:
-
- 8 edited
-
assets/css/jc-social-sharing.css (modified) (3 diffs)
-
inc/admin-page.php (modified) (2 diffs)
-
inc/functions.php (modified) (3 diffs)
-
inc/plugin.php (modified) (4 diffs)
-
languages/social-sharing-buttons-jc-es_ES.mo (modified) (previous)
-
languages/social-sharing-buttons-jc-es_ES.po (modified) (5 diffs)
-
readme.txt (modified) (5 diffs)
-
social-sharing-buttons-and-counters.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
social-sharing-buttons-and-counters/trunk/assets/css/jc-social-sharing.css
r2103525 r2110263 10 10 margin: 2px; 11 11 padding: 5px 10px; 12 min-width: 40px;13 12 border-radius: 3px; 14 13 box-shadow: none; … … 17 16 #jcss-buttons-container .jcss-button:hover { opacity: 0.9; } 18 17 19 #jcss-buttons-container a .fab { font-size: 15px; }18 #jcss-buttons-container a i { font-size: 16px; } 20 19 21 20 #jcss-buffer { background: #231F20; } … … 31 30 #jcss-social-buttons .jcss-social-name { color: #fff; font-weight: 700; margin-left: 5px; } 32 31 33 @media (max-width: 76 8px) {34 .jcss-social-name { display: none; }32 @media (max-width: 767px) { 33 .jcss-social-name.jcss-hide { display: none; } 35 34 } -
social-sharing-buttons-and-counters/trunk/inc/admin-page.php
r2103525 r2110263 75 75 <label><input type="radio" name="jcss_buttons_options[display_names]" value="1" <?php checked($options['display_names'], 1); ?> > <?php _e('Yes', 'social-sharing-buttons-jc'); ?></label> 76 76 <label><input type="radio" name="jcss_buttons_options[display_names]" value="0" <?php checked($options['display_names'], 0); ?> > <?php _e('No'); ?></label> 77 <p class="description"> <?php _e('Display social network names? You can hide them if you don\'t have enough room for the buttons', 'social-sharing-buttons-jc') ?></p> 77 <p class="description"> <?php _e('Display social network names? You can hide them if you don\'t have enough room for the buttons', 'social-sharing-buttons-jc') ?></p> 78 <p> 79 <label> 80 <input type="checkbox" name="jcss_buttons_options[hide_on_mobile]" <?php checked( $options['hide_on_mobile'] === 'on' ) ?>> 81 <?php _e("Always hide the social networks names on mobile screen sizes.", 'social-sharing-buttons-jc') ?> 82 </label> 83 </p> 78 84 </td> 79 85 </tr> … … 87 93 <option value="before" <?php selected($options['placement'], 'before') ?> ><?php _e('Before content', 'social-sharing-buttons-jc') ?></option> 88 94 <option value="after" <?php selected($options['placement'], 'after'); ?> ><?php _e('After content', 'social-sharing-buttons-jc') ?></option> 95 <option value="both" <?php selected($options['placement'], 'both'); ?> ><?php _e('Both', 'social-sharing-buttons-jc') ?></option> 89 96 </select> 90 97 </td> -
social-sharing-buttons-and-counters/trunk/inc/functions.php
r2103525 r2110263 6 6 } 7 7 8 define( 'JCSS_VERSION', '1.1.5' );9 10 function jcss_get_default_buttons_options() {11 12 $default_options = array();13 14 try {15 $default_options = array(16 'social_options' => 'Facebook,Twitter',17 'post_types' => array ( 'post' ),18 'placement' => 'after',19 'display_names' => 1,20 'display_shares' => 1,21 'twitter_username' => '',22 'sharing_text' => '',23 'sharing_text_position' => 'left',24 'sharing_text_weight' => 50025 );26 27 } catch( Exception $e) {28 }29 return $default_options;30 }31 32 8 function jcss_get_buttons_options() { 33 9 $options = array(); 34 10 35 11 try { 36 $options = get_option('jcss_buttons_options') ? get_option('jcss_buttons_options') : jcss_get_default_buttons_options(); 37 12 $db_options = get_option('jcss_buttons_options'); 13 $options = array( 14 'social_options' => isset($db_options['social_options']) ? $db_options['social_options'] : 'Facebook,Twitter', 15 'post_types' => isset($db_options['post_types']) ? $db_options['post_types'] : array ( 'post' ), 16 'placement' => isset($db_options['placement']) ? $db_options['placement'] : 'after', 17 'display_names' => isset($db_options['display_names']) ? $db_options['display_names'] : 1, 18 'hide_on_mobile' => isset($db_options['hide_on_mobile']) ? $db_options['hide_on_mobile'] : '0', 19 'twitter_username' => isset($db_options['twitter_username']) ? $db_options['twitter_username'] : '', 20 'sharing_text' => isset($db_options['sharing_text']) ? $db_options['sharing_text'] : '', 21 'sharing_text_position' => isset($db_options['sharing_text_position']) ? $db_options['sharing_text_position'] : 'left', 22 'sharing_text_weight' => isset($db_options['sharing_text_weight']) ? $db_options['sharing_text_weight'] : 500, 23 ); 38 24 } catch( Exception $e ) {} 39 25 … … 87 73 88 74 function jcss_get_social_name($options, $name) { 89 if (!empty($options['display_names'])) { ?> <span class="jcss-social-name"><?php echo $name; ?></span><?php } 75 if (!empty($options['display_names'])) 76 return printf('<span class="jcss-social-name%2$s">%1$s</span>', $name, empty($options['hide_on_mobile']) ? '' : ' jcss-hide'); 90 77 } 91 78 … … 118 105 if( isset( $input['placement'] ) ) $options['placement'] = sanitize_text_field( $input['placement'] ); 119 106 if( isset( $input['display_names'] ) ) $options['display_names'] = sanitize_text_field( $input['display_names'] ); 120 if( isset( $input['display_shares'] ) ) $options['display_shares'] = sanitize_text_field( $input['display_shares'] ); 107 if( isset( $input['hide_on_mobile'] ) ) $options['hide_on_mobile'] = sanitize_text_field( $input['hide_on_mobile'] ); 108 else $options['hide_on_mobile'] = '0'; 121 109 if( isset( $input['twitter_username'] ) ) $options['twitter_username'] = sanitize_text_field( $input['twitter_username'] ); 122 110 if( isset( $input['sharing_text'] ) ) $options['sharing_text'] = sanitize_text_field( $input['sharing_text'] ); -
social-sharing-buttons-and-counters/trunk/inc/plugin.php
r2103525 r2110263 11 11 foreach( $wp_styles->queue as $style ) { 12 12 foreach ($array_css as $css) { 13 if (false !== strpos( $ wp_styles->registered[$style]->src, $css )) {13 if (false !== strpos( $style, $css ) || false !== strpos( $wp_styles->registered[$style]->src, $css )) { 14 14 return 1; 15 15 } … … 25 25 26 26 /* enqueue styles to head, font-awesome only if wasn't enqueued before */ 27 $font_awesome = array('font-awesome', 'fontawesome' );27 $font_awesome = array('font-awesome', 'fontawesome', 'font_awesome'); 28 28 if (stylesheet_installed($font_awesome) === 0) { 29 29 wp_enqueue_style('jcss-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css'); … … 48 48 49 49 50 function jcss_add_social_buttons($content) 51 { 50 function jcss_add_social_buttons($content) { 52 51 $options = jcss_get_buttons_options(); 53 52 $jcss_content = $content; 54 53 55 if( !empty( $options['post_types'] ) && in_array( get_post_type(), $options['post_types'] ) && is_singular( $options['post_types'] ) ) 56 { 57 if ( !empty( $options['placement']) && $options['placement'] === "before") 54 if( !empty( $options['post_types'] ) && in_array( get_post_type(), $options['post_types'] ) && is_singular( $options['post_types'] ) ) { 55 if ( $options['placement'] === "before" ) 58 56 $jcss_content = jcss_social_buttons() . $content; 59 else 60 $jcss_content .= jcss_social_buttons(); 57 else if ( $options['placement'] === "after" ) 58 $jcss_content .= jcss_social_buttons(); 59 else 60 $jcss_content = jcss_social_buttons() . $content . jcss_social_buttons(); 61 61 } 62 62 return $jcss_content; … … 65 65 66 66 67 function jcss_load_plugin_textdomain() 68 { 67 function jcss_load_plugin_textdomain() { 69 68 load_plugin_textdomain( 'social-sharing-buttons-jc', false, 'social-sharing-buttons-and-counters/languages/' ); 70 69 } -
social-sharing-buttons-and-counters/trunk/languages/social-sharing-buttons-jc-es_ES.po
r2103525 r2110263 3 3 msgstr "" 4 4 "Project-Id-Version: Social sharing buttons and counters v1.0.0\n" 5 "Report-Msgid-Bugs-To: Translator Name <translations@example.com>\n" 6 "POT-Creation-Date: 2019-06-10 21:41+0200\n" 5 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/social-sharing-" 6 "buttons-and-counters\n" 7 "POT-Creation-Date: 2019-06-21 16:06:15+00:00\n" 7 8 "PO-Revision-Date: \n" 8 9 "Last-Translator: JC <info@josecarlosroman.com>\n" … … 59 60 msgstr "Textos en los botones " 60 61 61 #: inc/admin-page.php:75 inc/admin-page.php:1 8562 #: inc/admin-page.php:75 inc/admin-page.php:192 62 63 msgid "Yes" 63 64 msgstr "Sí" 64 65 65 #: inc/admin-page.php:76 inc/admin-page.php:1 8666 #: inc/admin-page.php:76 inc/admin-page.php:193 66 67 msgid "No" 67 68 msgstr "No" … … 75 76 "espacio para los botones" 76 77 77 #: inc/admin-page.php:83 78 #: inc/admin-page.php:81 79 msgid "Always hide the social networks names on mobile screen sizes." 80 msgstr "Ocultar siempre los nombres de las redes sociales en móviles." 81 82 #: inc/admin-page.php:89 78 83 msgid "Buttons location" 79 84 msgstr "Ubicación de los botones" 80 85 81 #: inc/admin-page.php: 8786 #: inc/admin-page.php:93 82 87 msgid "Before content" 83 88 msgstr "Antes del contenido" 84 89 85 #: inc/admin-page.php: 8890 #: inc/admin-page.php:94 86 91 msgid "After content" 87 92 msgstr "Después del contenido" 88 93 89 94 #: inc/admin-page.php:95 95 msgid "Both" 96 msgstr "Antes y después del contenido" 97 98 #: inc/admin-page.php:102 90 99 msgid "Add buttons to" 91 100 msgstr "Añadir los botones a" 92 101 93 #: inc/admin-page.php:1 14102 #: inc/admin-page.php:121 94 103 msgid "Sharing text" 95 104 msgstr "Texto junto a los botones" 96 105 97 #: inc/admin-page.php:1 18106 #: inc/admin-page.php:125 98 107 msgid "Share this!" 99 108 msgstr "¡Compártelo!" 100 109 101 #: inc/admin-page.php:1 19110 #: inc/admin-page.php:126 102 111 msgid "" 103 112 "Left the field empty if you don't want to display a text before the sharing " 104 113 "buttons" 105 114 msgstr "" 106 "Deja este campo vacío si no quieres mostrar ning ín texto delante de los "115 "Deja este campo vacío si no quieres mostrar ningún texto delante de los " 107 116 "botones" 108 117 109 #: inc/admin-page.php:1 26118 #: inc/admin-page.php:133 110 119 msgid "Sharing text position" 111 120 msgstr "Posición del texto" 112 121 113 #: inc/admin-page.php:13 0122 #: inc/admin-page.php:137 114 123 msgid "Left" 115 124 msgstr "A la izquierda" 116 125 117 #: inc/admin-page.php:13 1126 #: inc/admin-page.php:138 118 127 msgid "Above" 119 128 msgstr "Arriba" 120 129 121 #: inc/admin-page.php:1 37130 #: inc/admin-page.php:144 122 131 msgid "Sharing text weight" 123 msgstr " Espesor del texto"124 125 #: inc/admin-page.php:16 1132 msgstr "Grosor del texto" 133 134 #: inc/admin-page.php:168 126 135 msgid "Font Awesome 4 compatibility" 127 136 msgstr "Compatibilidad con Font Awesome 4" 128 137 129 #: inc/admin-page.php:1 66138 #: inc/admin-page.php:173 130 139 msgid "" 131 140 "Check ONLY if your theme still uses Font Awesome 4, take into account that " … … 135 144 "cuenta que algunos iconos pueden que no se muestren." 136 145 137 #: inc/admin-page.php:1 83146 #: inc/admin-page.php:190 138 147 msgid "Play animations?" 139 148 msgstr "¿Usar animaciones?" 140 149 141 #: inc/admin-page.php:1 89150 #: inc/admin-page.php:196 142 151 msgid "" 143 152 "Here you can decide whether or not to play animations when hovering over the " 144 153 "sharing buttons." 145 154 msgstr "" 146 "Aquí puedes decidir si quieres que iconos sociales se animen al hacer hover "147 " sobre los botones."148 149 #: inc/admin-page.php: 194155 "Aquí puedes decidir si quieres que los iconos sociales se animen al hacer " 156 "hover sobre los botones." 157 158 #: inc/admin-page.php:201 150 159 msgid "Animation Style" 151 160 msgstr "Estilo de la animación" 152 161 153 #: inc/admin-page.php: 198162 #: inc/admin-page.php:205 154 163 msgid "Fade" 155 164 msgstr "" 156 165 157 #: inc/admin-page.php: 199166 #: inc/admin-page.php:206 158 167 msgid "Slide" 159 168 msgstr "" 160 169 161 #: inc/admin-page.php:20 0170 #: inc/admin-page.php:207 162 171 msgid "Bounce" 163 172 msgstr "" 164 173 165 #: inc/admin-page.php:20 1174 #: inc/admin-page.php:208 166 175 msgid "Spin" 167 176 msgstr "" 168 177 169 #: inc/admin-page.php:2 07178 #: inc/admin-page.php:214 170 179 msgid "Animation Duration" 171 180 msgstr "Duración de la animación" 172 181 173 #: inc/admin-page.php:21 1182 #: inc/admin-page.php:218 174 183 msgid "300 miliseconds" 175 184 msgstr "300 milisegundos" 176 185 177 #: inc/admin-page.php:21 2186 #: inc/admin-page.php:219 178 187 msgid "500 miliseconds" 179 188 msgstr "500 milisegundos" 180 189 181 #: inc/admin-page.php:2 13190 #: inc/admin-page.php:220 182 191 msgid "700 miliseconds" 183 192 msgstr "700 milisegundos" 184 193 185 #: inc/admin-page.php:2 14194 #: inc/admin-page.php:221 186 195 msgid "1 second" 187 196 msgstr "1 segundo" 188 197 189 #: inc/admin-page.php:2 15198 #: inc/admin-page.php:222 190 199 msgid "2 seconds" 191 200 msgstr "2 segundos" 192 201 193 #: inc/admin-page.php:2 16202 #: inc/admin-page.php:223 194 203 msgid "3 seconds" 195 204 msgstr "3 segundos" 196 205 197 #: inc/admin-page.php:2 26206 #: inc/admin-page.php:233 198 207 msgid "" 199 208 "The shortcode <strong>[jc_buttons]</strong> will render the sharing buttons " … … 204 213 "los has configurado en esta página, ¡lo que te permitirá colocarlos " 205 214 "practicamente en cualquier parte!" 215 216 #. Plugin Name of the plugin/theme 217 msgid "Social Sharing Buttons" 218 msgstr "" 219 220 #. Description of the plugin/theme 221 msgid "" 222 "A lightweight SEO-friendly plugin that allows you to share your posts and " 223 "get more traffic" 224 msgstr "" 225 "Un plugin simple, ligero y SEO-friendly que te permite compartir tus posts y " 226 "conseguir más trafico" 227 228 #. Author of the plugin/theme 229 msgid "JC" 230 msgstr "" 231 232 #. Author URI of the plugin/theme 233 msgid "https://josecarlosroman.com/" 234 msgstr "" 206 235 207 236 #~ msgid "" -
social-sharing-buttons-and-counters/trunk/readme.txt
r2103525 r2110263 5 5 Requires at least: 4.0 6 6 Tested up to: 5.2 7 Stable tag: 1.2. 27 Stable tag: 1.2.3 8 8 License: GPL3 9 9 License URI: https://www.gnu.org/licenses/gpl.html … … 12 12 13 13 == Description == 14 14 15 Add buttons to share on Buffer, Facebook, LinkedIn, Twitter and WhatsApp. 15 16 … … 21 22 - Sharing support for Buffer, Facebook, LinkedIn, Twitter and WhatsApp. 22 23 - Allows you to drag and drop the buttons you want to display. 23 - Allows you to add the buttons to public post types.24 - Allows you to reorder the buttons. 24 25 - Allows you to display the buttons after/before the text content. 25 26 - Allows you to display a text before/above the buttons 26 27 - Allows you to hide the social media names. 27 28 - Allows you to play animations on hover. 28 - Fully responsive 29 - Fully responsive. 29 30 - Fully translated into Spanish (es_ES). You can contribute to translate this plugin by contacting the author. 30 31 - This plugin has a small file size and uses the necessary (just a few lines) JavaScript and CSS. 31 32 - This plugin doesn't use external libraries, only installs font-awesome if hasn't been installed yet. 32 - This plugin DOESN'T create any TABLES on the WordPress database. 33 - You can place the social buttons everywhere using the shortcodes this plugin provides. 33 - This plugin doesn't create any tables on the WordPress database. 34 34 35 35 == Support == … … 52 52 53 53 == Changelog == 54 55 = 1.2.3, date 2019-06-21 = 56 - Added the possibility to add the buttons both after and before the post content. 57 - Added the possibility to choose whether or not to hide the social names on mobile. 54 58 55 59 = 1.2.2, date 2019-06-10 = … … 105 109 106 110 - Initial release. 107 108 == Upgrade Notice ==109 110 = 1.2.1 =111 This plugin needs Font Awesome 5. If your theme is using a previous version please upgrade in order for the icons to be rendered. If not, just ignore this notice (Font Awesome will be installed by this plugin if needed).112 113 114 115 116 117 -
social-sharing-buttons-and-counters/trunk/social-sharing-buttons-and-counters.php
r2103525 r2110263 3 3 Plugin Name: Social Sharing Buttons 4 4 Description: A lightweight SEO-friendly plugin that allows you to share your posts and get more traffic 5 Version: 1.2. 25 Version: 1.2.3 6 6 Author: JC 7 7 Author URI: https://josecarlosroman.com/ … … 17 17 } 18 18 19 define('JCSS_PLUGIN_DIR', plugin_dir_path(__FILE__)); 20 define('JCSS_PLUGIN_URL', plugin_dir_url(__FILE__)); 19 define( 'JCSS_PLUGIN_DIR', plugin_dir_path(__FILE__) ); 20 define( 'JCSS_PLUGIN_URL', plugin_dir_url(__FILE__) ); 21 define( 'JCSS_VERSION', '1.2.3' ); 21 22 22 23 require_once JCSS_PLUGIN_DIR . 'inc/functions.php';
Note: See TracChangeset
for help on using the changeset viewer.