PluginProbe
Polylang / 2.7.3
Polylang v2.7.3
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / modules / plugins / wpseo-ogp.php

wpseo-ogp.php in Polylang 2.7.3, at modules/plugins/wpseo-ogp.php

53 lines 905 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use Yoast\WP\SEO\Presenters\Abstract_Indexable_Presenter;
4
5 /**
6 * Creates an Opengraph alternate locale meta tag to be consumed by Yoast SEO
7 * Requires Yoast SEO 14.0 or newer.
8 *
9 * @since 2.7.3
10 */
11 final class PLL_WPSEO_OGP extends Abstract_Indexable_Presenter {
12 /**
13 * Facebook locale
14 *
15 * @var string $locale
16 */
17 private $locale;
18
19 /**
20 * Constructor
21 *
22 * @since 2.7.3
23 *
24 * @param string $locale Facebook locale.
25 */
26 public function __construct( $locale ) {
27 $this->locale = $locale;
28 }
29
30 /**
31 * Returns the meta Opengraph alternate locale meta tag
32 *
33 * @since 2.7.3
34 *
35 * @return string
36 */
37 public function present() {
38 return sprintf( '<meta property="og:locale:alternate" content="%s" />', esc_attr( $this->get() ) );
39 }
40
41 /**
42 * Returns the alternate locale
43 *
44 * @since 2.7.3
45 *
46 * @return string
47 */
48 public function get() {
49 return $this->locale;
50 }
51 }
52
53