Changeset 11777
- Timestamp:
- 08/05/2009 04:43:51 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-filters.php
r11734 r11777 179 179 add_action('wp_head', 'wp_print_head_scripts', 9); 180 180 add_action('wp_head', 'wp_generator'); 181 add_action('wp_head', 'rel_canonical'); 181 182 add_action('wp_footer', 'wp_print_footer_scripts'); 182 183 if(!defined('DOING_CRON')) -
trunk/wp-includes/link-template.php
r11752 r11777 1807 1807 } 1808 1808 1809 /** 1810 * Output rel=canonical for singular queries 1811 * 1812 * @package WordPress 1813 * @since 2.9.0 1814 */ 1815 function rel_canonical() { 1816 if ( !is_singular() ) 1817 return; 1818 1819 global $wp_the_query; 1820 if ( !$id = $wp_the_query->get_queried_object_id() ) 1821 return; 1822 1823 $link = get_permalink( $id ); 1824 echo "<link rel='canonical' href='$link' />\n"; 1825 } 1826 1809 1827 ?>
Note: See TracChangeset
for help on using the changeset viewer.