diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 857d16fd60..f27d4d9e54 100644
|
|
function do_feed_atom( $for_comments ) { |
1522 | 1522 | * robots.txt file. |
1523 | 1523 | * |
1524 | 1524 | * @since 2.1.0 |
| 1525 | * @since 5.3.0 Remove the output if "Search Engine Visiblity" is discouraged. |
1525 | 1526 | */ |
1526 | 1527 | function do_robots() { |
1527 | 1528 | header( 'Content-Type: text/plain; charset=utf-8' ); |
… |
… |
function do_robots() { |
1535 | 1536 | |
1536 | 1537 | $output = "User-agent: *\n"; |
1537 | 1538 | $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"; |
1546 | 1544 | |
1547 | 1545 | /** |
1548 | 1546 | * Filters the robots.txt output. |