Ticket #18660: link-template.php.diff
File link-template.php.diff, 2.2 KB (added by , 13 years ago) |
---|
-
wp-includes/post-template.php
166 166 $content = get_the_content($more_link_text, $stripteaser); 167 167 $content = apply_filters('the_content', $content); 168 168 $content = str_replace(']]>', ']]>', $content); 169 170 do_action( 'before_the_content', $content ); 169 171 echo $content; 172 do_action( 'after_the_content', $content ); 170 173 } 171 174 172 175 /** -
wp-includes/link-template.php
2355 2355 } 2356 2356 2357 2357 /** 2358 * Output rel=canonical for singular queries2358 * Output rel=canonical for home, singular, author archives, and taxonomy archives. 2359 2359 * 2360 2360 * @package WordPress 2361 2361 * @since 2.9.0 2362 2362 */ 2363 2363 function rel_canonical() { 2364 if ( !is_singular() ) 2365 return; 2364 2365 global $wp_query; 2366 2367 /** Get the object ID */ 2368 $id = $wp_query->get_queried_object_id(); 2366 2369 2367 global $wp_the_query; 2368 if ( !$id = $wp_the_query->get_queried_object_id() ) 2370 $canonical = ''; 2371 2372 if ( is_front_page() ) { 2373 $canonical = trailingslashit( home_url() ); 2374 } 2375 2376 if ( is_singular() ) { 2377 $canonical = get_permalink( absint( $id ) ); 2378 } 2379 2380 if ( is_category() || is_tag() || is_tax() ) { 2381 $canonical = get_term_link( absint( $id ), $wp_query->queried_object->taxonomy ); 2382 } 2383 2384 if ( is_author() ) { 2385 $canonical = get_author_posts_url( absint( $id ) ); 2386 } 2387 2388 $canonical = apply_filters( 'rel_canonical', $canonical, $id ); 2389 2390 /** If empty, return nothing */ 2391 if ( ! $canonical ) 2369 2392 return; 2370 2393 2371 $link = get_permalink( $id);2372 echo "<link rel='canonical' href='$link' />\n"; 2394 printf( '<link rel="canonical" href="%s" />' . "\n", esc_url( $canonical ) ); 2395 2373 2396 } 2374 2397 2375 2398 /** -
wp-content/themes/twentyten/header.php
88 88 </div><!-- #header --> 89 89 90 90 <div id="main"> 91 92 <?php echo simple_cycle( array( 'id' => 323 ) ); ?>