PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 19.0
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v19.0
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / presenters / bingbot-presenter.php

bingbot-presenter.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 19.0, at src/presenters/bingbot-presenter.php

67 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Presenters;
4
5 use Yoast\WP\SEO\Presentations\Indexable_Presentation;
6
7 \_deprecated_file( \basename( __FILE__ ), 'WPSEO 14.9' );
8
9 /**
10 * Presenter class for the bingbot output.
11 */
12 class Bingbot_Presenter extends Abstract_Indexable_Presenter {
13
14 /**
15 * Returns the bingbot output.
16 *
17 * @deprecated 14.9 Values merged into the robots meta tag.
18 * @codeCoverageIgnore
19 *
20 * @return string The bingbot output tag.
21 */
22 public function present() {
23 \_deprecated_function( __METHOD__, 'WPSEO 14.9' );
24
25 $bingbot = \implode( ', ', $this->get() );
26 $bingbot = $this->filter( $bingbot );
27
28 if ( \is_string( $bingbot ) && $bingbot !== '' ) {
29 return \sprintf( '<meta name="bingbot" content="%s" />', \esc_attr( $bingbot ) );
30 }
31
32 return '';
33 }
34
35 /**
36 * Gets the raw value of a presentation.
37 *
38 * @deprecated 14.9 Values merged into the robots meta tag.
39 * @codeCoverageIgnore
40 *
41 * @return array The raw value.
42 */
43 public function get() {
44 \_deprecated_function( __METHOD__, 'WPSEO 14.9' );
45
46 return $this->presentation->bingbot;
47 }
48
49 /**
50 * Run the bingbot output content through the `wpseo_bingbot` filter.
51 *
52 * @param string $bingbot The meta bingbot output to filter.
53 *
54 * @return string The filtered meta bingbot output.
55 */
56 private function filter( $bingbot ) {
57 /**
58 * Filter: 'wpseo_bingbot' - Allows filtering of the meta bingbot output of Yoast SEO.
59 *
60 * @api string $bingbot The meta bingbot directives to be echoed.
61 *
62 * @param Indexable_Presentation $presentation The presentation of an indexable.
63 */
64 return (string) \apply_filters( 'wpseo_bingbot', $bingbot, $this->presentation );
65 }
66 }
67