| 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 |
|