PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | modules/likes/jetpack-likes-master-iframe.php +19 -18 13.9.216.3-a.1 View file →
@@ -19,30 +19,31 @@
19 19
20 20 require_once JETPACK__GLOTPRESS_LOCALES_PATH;
21 21
22 22 $gp_locale = GP_Locales::by_field( 'wp_locale', $_locale );
23 - $_locale = isset( $gp_locale->slug ) ? $gp_locale->slug : '';
23 + if ( ! $gp_locale ) {
24 + $gp_locale = GP_Locales::by_slug( $_locale );
25 + }
26 + $_locale = $gp_locale->slug ?? '';
24 27
25 28 $likes_locale = ( '' === $_locale || 'en' === $_locale ) ? '' : '&lang=' . strtolower( $_locale );
26 - /** This filter is documented in projects/plugins/jetpack/modules/likes.php */
27 - $new_layout = apply_filters( 'likes_new_layout', true ) ? '&n=1' : '';
28 - $new_layout_class = $new_layout ? 'wpl-new-layout' : '';
29 29
30 - $src = sprintf(
31 - 'https://widgets.wp.com/likes/master.html?ver=%1$s#ver=%1$s%2$s%3$s',
32 - $version,
33 - $likes_locale,
34 - $new_layout
35 - );
30 + $src = sprintf( 'https://widgets.wp.com/likes/master.html?ver=%1$s#ver=%1$s%2$s', $version, $likes_locale );
36 31
37 - if ( $new_layout ) {
38 - // The span content is replaced by queuehandler when showOtherGravatars is called.
39 - $likers_text = wp_kses( '<span>%d</span>', array( 'span' => array() ) );
40 - } else {
41 - /* translators: The value of %d is not available at the time of output */
42 - $likers_text = wp_kses( __( '<span>%d</span> bloggers like this:', 'jetpack' ), array( 'span' => array() ) );
43 - }
32 + /**
33 + * Filters the Likes iframe src, if any parameters need to be overridden or tracked.
34 + *
35 + * @module likes
36 + *
37 + * @since 14.1
38 + *
39 + * @param string URL to https://widgets.wp.com/ with various arguments appended to the get string and fragment.
40 + */
41 + $src = apply_filters( 'jetpack_likes_iframe_src', $src );
42 +
43 + // The span content is replaced by queuehandler when showOtherGravatars is called.
44 + $likers_text = wp_kses( '<span>%d</span>', array( 'span' => array() ) );
44 45 ?>
45 46 <iframe src='<?php echo esc_url( $src ); ?>' scrolling='no' id='likes-master' name='likes-master' style='display:none;'></iframe>
46 - <div id='likes-other-gravatars' class='<?php echo esc_attr( $new_layout_class ); ?>' role="dialog" aria-hidden="true" tabindex="-1"><div class="likes-text"><?php echo $likers_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><ul class="wpl-avatars sd-like-gravatars"></ul></div>
47 + <div id='likes-other-gravatars' role="dialog" aria-hidden="true" tabindex="-1"><div class="likes-text"><?php echo $likers_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><ul class="wpl-avatars sd-like-gravatars"></ul></div>
47 48 <?php
48 49 }