| @@ -3,15 +3,15 @@ | ||
| 3 | 3 | * @package Polylang |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | - * Manages the compatibility with Jetpack | |
| 7 | + * Manages the compatibility with Jetpack. | |
| 8 | 8 | * |
| 9 | 9 | * @since 2.3 |
| 10 | 10 | */ |
| 11 | 11 | class PLL_Jetpack { |
| 12 | 12 | /** |
| 13 | - * Constructor | |
| 13 | + * Constructor. | |
| 14 | 14 | * |
| 15 | 15 | * @since 2.3 |
| 16 | 16 | */ |
| 17 | 17 | public function __construct() { |
| @@ -20,9 +20,9 @@ | ||
| 20 | 20 | add_filter( 'grunion_contact_form_field_html', array( $this, 'grunion_contact_form_field_html_filter' ), 10, 2 ); |
| 21 | 21 | add_filter( 'jetpack_open_graph_tags', array( $this, 'jetpack_ogp' ) ); |
| 22 | 22 | add_filter( 'jetpack_relatedposts_filter_filters', array( $this, 'jetpack_relatedposts_filter_filters' ), 10, 2 ); |
| 23 | 23 | |
| 24 | - // Jetpack infinite scroll | |
| 24 | + // Jetpack infinite scroll. | |
| 25 | 25 | if ( isset( $_GET['infinity'], $_POST['action'] ) && 'infinite_scroll' == $_POST['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification |
| 26 | 26 | add_filter( 'pll_is_ajax_on_front', '__return_true' ); |
| 27 | 27 | } |
| 28 | 28 | } |
| @@ -36,9 +36,9 @@ | ||
| 36 | 36 | if ( ! defined( 'JETPACK__VERSION' ) ) { |
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - // Infinite scroll ajax url must be on the right domain | |
| 40 | + // Infinite scroll ajax url must be on the right domain. | |
| 41 | 41 | if ( did_action( 'pll_init' ) && PLL()->options['force_lang'] > 1 ) { |
| 42 | 42 | add_filter( 'infinite_scroll_ajax_url', array( PLL()->links_model, 'site_url' ) ); |
| 43 | 43 | add_filter( 'infinite_scroll_js_settings', array( $this, 'jetpack_infinite_scroll_js_settings' ) ); |
| 44 | 44 | } |
| @@ -65,9 +65,9 @@ | ||
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Filter the HTML of the Contact Form and output the one requested by language. |
| 68 | 68 | * Adapted from the same function in jetpack-3.0.2/3rd-party/wpml.php |
| 69 | - * Keeps using 'icl_translate' as the function registers the string | |
| 69 | + * Keeps using 'icl_translate' as the function registers the string. | |
| 70 | 70 | * |
| 71 | 71 | * @since 1.5.4 |
| 72 | 72 | * |
| 73 | 73 | * @param string $r Contact Form HTML output. |
| @@ -85,13 +85,13 @@ | ||
| 85 | 85 | return $r; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | - * Adds opengraph support for locale and translations | |
| 89 | + * Adds opengraph support for locale and translations. | |
| 90 | 90 | * |
| 91 | 91 | * @since 1.6 |
| 92 | 92 | * |
| 93 | - * @param array $tags opengraph tags to output | |
| 93 | + * @param array $tags Opengraph tags to output. | |
| 94 | 94 | * @return array |
| 95 | 95 | */ |
| 96 | 96 | public function jetpack_ogp( $tags ) { |
| 97 | 97 | if ( did_action( 'pll_init' ) ) { |
| @@ -107,9 +107,9 @@ | ||
| 107 | 107 | return $tags; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * Allows to make sure that related posts are in the correct language | |
| 111 | + * Allows to make sure that related posts are in the correct language. | |
| 112 | 112 | * |
| 113 | 113 | * @since 1.8 |
| 114 | 114 | * |
| 115 | 115 | * @param array $filters Array of ElasticSearch filters based on the post_id and args. |
| @@ -122,16 +122,16 @@ | ||
| 122 | 122 | return $filters; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | - * Fixes the settings history host for infinite scroll when using subdomains or multiple domains | |
| 126 | + * Fixes the settings history host for infinite scroll when using subdomains or multiple domains. | |
| 127 | 127 | * |
| 128 | 128 | * @since 2.1 |
| 129 | 129 | * |
| 130 | - * @param array $settings | |
| 130 | + * @param array $settings Infinite scroll JS settings outputted in the head. | |
| 131 | 131 | * @return array |
| 132 | 132 | */ |
| 133 | 133 | public function jetpack_infinite_scroll_js_settings( $settings ) { |
| 134 | - $settings['history']['host'] = wp_parse_url( pll_home_url(), PHP_URL_HOST ); // Jetpack uses get_option( 'home' ) | |
| 134 | + $settings['history']['host'] = wp_parse_url( pll_home_url(), PHP_URL_HOST ); // Jetpack uses get_option( 'home' ). | |
| 135 | 135 | return $settings; |
| 136 | 136 | } |
| 137 | 137 | } |