| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Helpers; |
| 4 |
|
| 5 |
/** |
| 6 |
* A helper object for the robots meta tag. |
| 7 |
*/ |
| 8 |
class Robots_Helper { |
| 9 |
|
| 10 |
/** |
| 11 |
* Sets the robots index to noindex. |
| 12 |
* |
| 13 |
* @param array $robots The current robots value. |
| 14 |
* |
| 15 |
* @return array The altered robots string. |
| 16 |
*/ |
| 17 |
public function set_robots_no_index( $robots ) { |
| 18 |
if ( ! \is_array( $robots ) ) { |
| 19 |
\_deprecated_argument( __METHOD__, '14.1', '$robots has to be a key-value paired array.' ); |
| 20 |
return $robots; |
| 21 |
} |
| 22 |
|
| 23 |
$robots['index'] = 'noindex'; |
| 24 |
|
| 25 |
return $robots; |
| 26 |
} |
| 27 |
} |
| 28 |
|