WordPress.org

Make WordPress Core

Ticket #43590: 43590.diff

File 43590.diff, 1.1 KB (added by donmhico, 4 months ago)
  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index 857d16fd60..f27d4d9e54 100644
    function do_feed_atom( $for_comments ) { 
    15221522 * robots.txt file.
    15231523 *
    15241524 * @since 2.1.0
     1525 * @since 5.3.0 Remove the output if "Search Engine Visiblity" is discouraged.
    15251526 */
    15261527function do_robots() {
    15271528        header( 'Content-Type: text/plain; charset=utf-8' );
    function do_robots() { 
    15351536
    15361537        $output = "User-agent: *\n";
    15371538        $public = get_option( 'blog_public' );
    1538         if ( '0' == $public ) {
    1539                 $output .= "Disallow: /\n";
    1540         } else {
    1541                 $site_url = parse_url( site_url() );
    1542                 $path     = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : '';
    1543                 $output  .= "Disallow: $path/wp-admin/\n";
    1544                 $output  .= "Allow: $path/wp-admin/admin-ajax.php\n";
    1545         }
     1539       
     1540        $site_url = parse_url( site_url() );
     1541        $path     = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : '';
     1542        $output  .= "Disallow: $path/wp-admin/\n";
     1543        $output  .= "Allow: $path/wp-admin/admin-ajax.php\n";
    15461544
    15471545        /**
    15481546         * Filters the robots.txt output.