do_robots [ WordPress Function ]
do_robots ( No parameters )
| Uses: | |
| Defined at: |
|
Display the robots.txt file content.
The echo content should be with usage of the permalinks or for creating the robots.txt file.
Source
<?php
function do_robots() {
header( 'Content-Type: text/plain; charset=utf-8' );
do_action( 'do_robotstxt' );
$output = "User-agent: *\n";
$public = get_option( 'blog_public' );
if ( '0' == $public ) {
$output .= "Disallow: /\n";
} else {
$site_url = parse_url( site_url() );
$path = ( !empty( $site_url['path'] ) ) ? $site_url['path'] : '';
$output .= "Disallow: $path/wp-admin/\n";
$output .= "Disallow: $path/wp-includes/\n";
}
echo apply_filters('robots_txt', $output, $public);
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/do robots « WordPress Codex
Tanım. robot.txtdosyasının içeriğini görüntüler. Kullanım. <?php do_robots() ?> Parametreler. Yok. Döndürülen Değerler. (void): Bu fonksiyon bir değer ...
codex.wordpress.org - #11918 (do_robots() Enhancement) – WordPress Trac
do_robots(), in wp-includes/functions.php, is currently responsible for handling robots.txt requests for sites that do not have a robots.txt file. The default rules are ...
core.trac.wordpress.org - do_robots Wordpress hook details -- Adam Brown, BYU Political ...
Detailed information about every action hook and filter used in WordPress. Makes Plugin API easier to use. Lists appearance, file location, and deprecation data ...
adambrown.info - do_robots (WordPress Function) - WPSeek.com
WordPress lookup for do_robots, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- Joost de Valk on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"
- Umbrovskis.com on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"
- Joost de Valk on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"
- KellyAWP on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"
- KellyAWP on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"
- KellyAWP on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"
- Umbrovskis.com on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"
- Umbrovskis.com on "[Plugin: WordPress SEO by Yoast] incompitable vith functions do_robotstxt & do_robots"