WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/17/2021 10:49:13 AM (8 months ago)
Author:
SergeyBiryukov
Message:

Robots: Rename wp_embed_no_robots to wp_robots_noindex_embeds().

This brings the naming in line with wp_robots_noindex_search().

Follow-up to [49992], [50370].

See #51511, #52457.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/robots-template.php

    r50370 r50371  
    7575 *
    7676 * @since 5.7.0
     77 *
    7778 * @see wp_robots_no_robots()
    7879 *
     
    8990
    9091/**
     92 * Adds noindex to the robots meta tag for embeds.
     93 *
     94 * Typical usage is as a {@see 'wp_robots'} callback:
     95 *
     96 *     add_filter( 'wp_robots', 'wp_robots_noindex_embeds' );
     97 *
     98 * @since 5.7.0
     99 *
     100 * @see wp_robots_no_robots()
     101 *
     102 * @param array $robots Associative array of robots directives.
     103 * @return array Filtered robots directives.
     104 */
     105function wp_robots_noindex_embeds( array $robots ) {
     106    if ( is_embed() ) {
     107        return wp_robots_no_robots( $robots );
     108    }
     109
     110    return $robots;
     111}
     112
     113/**
    91114 * Adds noindex to the robots meta tag if a search is being performed.
    92115 *
     
    100123 *
    101124 * @since 5.7.0
     125 *
    102126 * @see wp_robots_no_robots()
    103127 *
Note: See TracChangeset for help on using the changeset viewer.