Changeset 3791
- Timestamp:
- 05/22/2006 10:06:06 PM (19 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r3789 r3791 74 74 75 75 class WP { 76 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview' );76 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots'); 77 77 78 78 var $private_query_vars = array('posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type'); -
trunk/wp-includes/default-filters.php
r3788 r3791 95 95 add_action('do_feed_atom', 'do_feed_atom', 10, 1); 96 96 add_action('do_pings', 'do_all_pings', 10, 1); 97 add_action('do_robots', 'do_robots'); 97 98 ?> -
trunk/wp-includes/functions.php
r3758 r3791 1656 1656 } 1657 1657 1658 function do_robots() { 1659 if ( '1' != get_option('blog_public') ) { 1660 echo "User-agent: *\n"; 1661 echo "Disallow: /\n"; 1662 } else { 1663 echo "User-agent: *\n"; 1664 echo "Disallow:\n"; 1665 } 1666 } 1667 1658 1668 function is_blog_installed() { 1659 1669 global $wpdb; -
trunk/wp-includes/query.php
r3772 r3791 156 156 157 157 return $wp_query->is_preview; 158 } 159 160 function is_robots() { 161 global $wp_query; 162 163 return $wp_query->is_robots; 158 164 } 159 165 … … 273 279 var $is_admin = false; 274 280 var $is_attachment = false; 281 var $is_robots = false; 275 282 276 283 function init_query_flags() { … … 293 300 $this->is_admin = false; 294 301 $this->is_attachment = false; 302 $this->is_robots = false; 295 303 } 296 304 … … 320 328 $this->query = $query; 321 329 $this->query_vars = $qv; 330 } 331 332 if ( ! empty($qv['robots']) ) { 333 $this->is_robots = true; 334 return; 322 335 } 323 336 -
trunk/wp-includes/rewrite.php
r3712 r3791 697 697 } 698 698 699 // robots.txt 700 $robots_rewrite = array('robots.txt$' => $this->index . '?robots=1'); 701 699 702 // Post 700 703 $post_rewrite = $this->generate_rewrite_rules($this->permalink_structure, EP_PERMALINK); … … 731 734 732 735 // Put them together. 733 $this->rules = array_merge($ page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);736 $this->rules = array_merge($robots_rewrite, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules); 734 737 735 738 do_action('generate_rewrite_rules', array(&$this)); -
trunk/wp-includes/template-loader.php
r3638 r3791 2 2 if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) { 3 3 do_action('template_redirect'); 4 if ( is_feed() ) { 4 if ( is_robots() ) { 5 do_action('do_robots'); 6 exit; 7 } else if ( is_feed() ) { 5 8 do_feed(); 6 9 exit; … … 56 59 } else { 57 60 // Process feeds and trackbacks even if not using themes. 58 if ( is_feed() ) { 61 if ( is_robots() ) { 62 do_action('do_robots'); 63 exit; 64 } else if ( is_feed() ) { 59 65 do_feed(); 60 66 exit;
Note: See TracChangeset
for help on using the changeset viewer.