Changeset 45928 for trunk/src/wp-includes/functions.php
- Timestamp:
- 09/02/2019 02:26:55 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r45926 r45928 1583 1583 * 1584 1584 * @since 2.1.0 1585 * @since 5.3.0 Remove the "Disallow: /" output if search engine visiblity is 1586 * discouraged in favor of robots meta HTML tag in wp_no_robots(). 1585 1587 */ 1586 1588 function do_robots() { … … 1596 1598 $output = "User-agent: *\n"; 1597 1599 $public = get_option( 'blog_public' ); 1598 if ( '0' == $public ) { 1599 $output .= "Disallow: /\n"; 1600 } else { 1601 $site_url = parse_url( site_url() ); 1602 $path = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : ''; 1603 $output .= "Disallow: $path/wp-admin/\n"; 1604 $output .= "Allow: $path/wp-admin/admin-ajax.php\n"; 1605 } 1600 1601 $site_url = parse_url( site_url() ); 1602 $path = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : ''; 1603 $output .= "Disallow: $path/wp-admin/\n"; 1604 $output .= "Allow: $path/wp-admin/admin-ajax.php\n"; 1606 1605 1607 1606 /**
Note: See TracChangeset
for help on using the changeset viewer.