Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_robots

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
22       *
23       * The meta tag will only be included as necessary.
24       *
25       * @since 5.7.0
26       *
27       * @param array $robots Associative array of directives. Every key must be the name of the directive, and the
28       *                      corresponding value must either be a string to provide as value for the directive or a
29       *                      boolean `true` if it is a boolean directive, i.e. without a value.
30       */
31      $robots = apply_filters( 'wp_robots', array() );
32
33      // Don't allow mutually exclusive directives.
34      if ( ! empty( $robots['follow'] ) ) {
35           unset( $robots['nofollow'] );
36      }
37      if ( ! empty( $robots['nofollow'] ) ) {
38           unset( $robots['follow'] );
39      }
40      if ( ! empty( $robots['archive'] ) ) {