PluginProbe
Polylang / trunk
Polylang vtrunk
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 / src / integrations / wpseo / wpseo-ogp.php

wpseo-ogp.php in Polylang trunk, at src/integrations/wpseo/wpseo-ogp.php

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