| 1 |
<?php |
| 2 |
|
| 3 |
// Exit if accessed directly |
| 4 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 5 |
|
| 6 |
class Vimeography_Robots { |
| 7 |
|
| 8 |
public function __construct() { |
| 9 |
add_action( 'do_robots', array($this, 'vimeography_block_robots') ); |
| 10 |
} |
| 11 |
|
| 12 |
/** |
| 13 |
* Adds the VIMEOGRAPHY_ASSETS_URL to the virtual robots.txt restricted list. |
| 14 |
* Fired when the template loader determines a robots.txt request. |
| 15 |
* |
| 16 |
* @access public |
| 17 |
* @static |
| 18 |
* @return void |
| 19 |
*/ |
| 20 |
public static function vimeography_block_robots() { |
| 21 |
$blocked_asset_path = str_ireplace(site_url(), '', VIMEOGRAPHY_ASSETS_URL); |
| 22 |
echo 'Disallow: '.$blocked_asset_path."\n"; |
| 23 |
} |
| 24 |
|
| 25 |
} |
| 26 |
|