| Conditions | 9 |
| Paths | 52 |
| Total Lines | 33 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | function jetpack_likes_master_iframe() { |
||
| 7 | $version = '20170629'; |
||
| 8 | $in_jetpack = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? false : true; |
||
| 9 | |||
| 10 | $_locale = get_locale(); |
||
| 11 | |||
| 12 | // We have to account for w.org vs WP.com locale divergence |
||
| 13 | if ( $in_jetpack ) { |
||
| 14 | if ( ! defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) || ! file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) { |
||
| 15 | return false; |
||
| 16 | } |
||
| 17 | |||
| 18 | require_once JETPACK__GLOTPRESS_LOCALES_PATH; |
||
| 19 | |||
| 20 | $gp_locale = GP_Locales::by_field( 'wp_locale', $_locale ); |
||
| 21 | $_locale = isset( $gp_locale->slug ) ? $gp_locale->slug : ''; |
||
| 22 | } |
||
| 23 | |||
| 24 | $likes_locale = ( '' == $_locale || 'en' == $_locale ) ? '' : '&lang=' . strtolower( $_locale ); |
||
| 25 | |||
| 26 | $src = sprintf( |
||
| 27 | 'https://widgets.wp.com/likes/master.html?ver=%1$s#ver=%1$s%2$s', |
||
| 28 | $version, |
||
| 29 | $likes_locale |
||
| 30 | ); |
||
| 31 | |||
| 32 | /* translators: The value of %d is not available at the time of output */ |
||
| 33 | $likersText = wp_kses( __( '<span>%d</span> bloggers like this:', 'jetpack' ), array( 'span' => array() ) ); |
||
| 34 | ?> |
||
| 35 | <iframe src='<?php echo $src; ?>' scrolling='no' id='likes-master' name='likes-master' style='display:none;'></iframe> |
||
| 36 | <div id='likes-other-gravatars'><div class="likes-text"><?php echo $likersText; ?></div><ul class="wpl-avatars sd-like-gravatars"></ul></div> |
||
| 37 | <?php |
||
| 38 | } |
||
| 39 |