Action hook 'do_robots'

in WP Core File wp-includes/template-loader.php at line 37

View Source

do_robots

Action Hook
Description
Fired when the template loader determines a robots.txt request.

Hook Information

File Location wp-includes/template-loader.php View on GitHub
Hook Type Action
Line Number 37

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into do_robots
add_action('do_robots', 'my_custom_function');

function my_custom_function() {
    // Your custom code here
}

Source Code Context

wp-includes/template-loader.php:37 - How this hook is used in WordPress core
<?php
  32  	/**
  33  	 * Fired when the template loader determines a robots.txt request.
  34  	 *
  35  	 * @since 2.1.0
  36  	 */
  37  	do_action( 'do_robots' );
  38  	return;
  39  } elseif ( is_favicon() ) {
  40  	/**
  41  	 * Fired when the template loader determines a favicon.ico request.
  42  	 *

PHP Documentation

<?php
/**
	 * Fired when the template loader determines a robots.txt request.
	 *
	 * @since 2.1.0
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-includes/template-loader.php
Related Hooks

Related hooks will be displayed here in future updates.