jetpack-likes-master-iframe.php
3 years ago
jetpack-likes-settings.php
3 years ago
post-count-jetpack.js
4 years ago
post-count.js
4 years ago
queuehandler.js
4 years ago
style.css
4 years ago
jetpack-likes-master-iframe.php
40 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack likes iframe. |
| 4 | * |
| 5 | * @package jetpack |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * This function needs to get loaded after the like scripts get added to the page. |
| 10 | */ |
| 11 | function jetpack_likes_master_iframe() { |
| 12 | $version = gmdate( 'YW' ); |
| 13 | |
| 14 | $_locale = get_locale(); |
| 15 | |
| 16 | if ( ! defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) || ! file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) { |
| 17 | return false; |
| 18 | } |
| 19 | |
| 20 | require_once JETPACK__GLOTPRESS_LOCALES_PATH; |
| 21 | |
| 22 | $gp_locale = GP_Locales::by_field( 'wp_locale', $_locale ); |
| 23 | $_locale = isset( $gp_locale->slug ) ? $gp_locale->slug : ''; |
| 24 | |
| 25 | $likes_locale = ( '' === $_locale || 'en' === $_locale ) ? '' : '&lang=' . strtolower( $_locale ); |
| 26 | |
| 27 | $src = sprintf( |
| 28 | 'https://widgets.wp.com/likes/master.html?ver=%1$s#ver=%1$s%2$s', |
| 29 | $version, |
| 30 | $likes_locale |
| 31 | ); |
| 32 | |
| 33 | /* translators: The value of %d is not available at the time of output */ |
| 34 | $likers_text = wp_kses( __( '<span>%d</span> bloggers like this:', 'jetpack' ), array( 'span' => array() ) ); |
| 35 | ?> |
| 36 | <iframe src='<?php echo esc_url( $src ); ?>' scrolling='no' id='likes-master' name='likes-master' style='display:none;'></iframe> |
| 37 | <div id='likes-other-gravatars'><div class="likes-text"><?php echo $likers_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><ul class="wpl-avatars sd-like-gravatars"></ul></div> |
| 38 | <?php |
| 39 | } |
| 40 |