Ticket #26253: 26253.3.diff
| File 26253.3.diff, 8.0 KB (added by , 13 years ago) |
|---|
-
wp-includes/feed.php
27 27 */ 28 28 function get_bloginfo_rss($show = '') { 29 29 $info = strip_tags(get_bloginfo($show)); 30 /** 31 * Filter the bloginfo for use in feeds. 32 * 33 * @since 2.2.0 34 * 35 * @param string $string Converted string value of the blog information. 36 * @param string $show Optional keyword naming the blog information you want. 37 */ 30 38 return apply_filters('get_bloginfo_rss', convert_chars($info), $show); 31 39 } 32 40 … … 46 54 * @param string $show See get_bloginfo() for possible values. 47 55 */ 48 56 function bloginfo_rss($show = '') { 57 /** 58 * Filter the RSS container for the bloginfo for use in feeds. 59 * 60 * @since 2.1.0 61 * 62 * @param string $string RSS container for the blog information. 63 * @param string $show Optional keyword naming the blog information you want. 64 */ 49 65 echo apply_filters('bloginfo_rss', get_bloginfo_rss($show), $show); 50 66 } 51 67 … … 63 79 * @return string Default feed, or for example 'rss2', 'atom', etc. 64 80 */ 65 81 function get_default_feed() { 82 /** 83 * Filter the default feed type. 84 * 85 * @since 2.5.0 86 * 87 * @param string $feed_type Default feed type, for example 'rss2', 'atom', etc. 88 */ 66 89 $default_feed = apply_filters('default_feed', 'rss2'); 67 90 return 'rss' == $default_feed ? 'rss2' : $default_feed; 68 91 } … … 83 106 $title = wp_title($sep, false); 84 107 if ( is_wp_error( $title ) ) 85 108 return $title->get_error_message(); 109 /** 110 * Filter the blog title for the feed title. 111 * 112 * @since 2.2.0 113 * 114 * @param string $title The current post title returned by wp_title(). 115 * @param string $sep Optional separator. 116 */ 86 117 $title = apply_filters( 'get_wp_title_rss', $title, $sep ); 87 118 return $title; 88 119 } … … 99 130 * @param string $sep Optional. 100 131 */ 101 132 function wp_title_rss( $sep = '»' ) { 133 /** 134 * Filter the the blog title for display of the feed title. 135 * 136 * @since 2.2.0 137 * 138 * @param string $string The current post title returned by get_wp_title_rss(). 139 * @param string $sep Optional separator. 140 */ 102 141 echo apply_filters( 'wp_title_rss', get_wp_title_rss( $sep ), $sep ); 103 142 } 104 143 … … 114 153 */ 115 154 function get_the_title_rss() { 116 155 $title = get_the_title(); 156 /** 157 * Filter the post title for the feed. 158 * 159 * @since 1.2.1 160 * 161 * @param string $title The current post title returned by get_the_title(). 162 */ 117 163 $title = apply_filters('the_title_rss', $title); 118 164 return $title; 119 165 } … … 146 192 if ( !$feed_type ) 147 193 $feed_type = get_default_feed(); 148 194 195 /** This filter is documented in wp-admin/post-template.php */ 149 196 $content = apply_filters('the_content', get_the_content()); 150 197 $content = str_replace(']]>', ']]>', $content); 198 /** 199 * Filter the post content for use in feeds. 200 * 201 * @since 2.9.0 202 * 203 * @param string $content The current post content. 204 * @param string $feed_type Feed type returned by get_default_feed(), for example 'rss2', 'atom', etc. 205 */ 151 206 return apply_filters('the_content_feed', $content, $feed_type); 152 207 } 153 208 … … 176 231 */ 177 232 function the_excerpt_rss() { 178 233 $output = get_the_excerpt(); 234 /** 235 * Filter the post excerpt for the feed. 236 * 237 * @since 1.2.1 238 * 239 * @param string $output The current post excerpt returned by get_the_excerpt(). 240 */ 179 241 echo apply_filters('the_excerpt_rss', $output); 180 242 } 181 243 … … 188 250 * @uses apply_filters() Call 'the_permalink_rss' on the post permalink 189 251 */ 190 252 function the_permalink_rss() { 253 /** 254 * Filter the permalink to the post for use in feeds. 255 * 256 * @since 2.3.0 257 * 258 * @param string $string The current post permalink. 259 */ 191 260 echo esc_url( apply_filters('the_permalink_rss', get_permalink() )); 192 261 } 193 262 … … 198 267 * @return none 199 268 */ 200 269 function comments_link_feed() { 270 /** 271 * Filter the permalink to the comments for the current post. 272 * 273 * @since 3.6.0 274 * 275 * @param string $string The current comment permalink with '#comments' appended. 276 */ 201 277 echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) ); 202 278 } 203 279 … … 239 315 * @since 1.5.0 240 316 */ 241 317 function comment_link() { 318 /** 319 * Filter the permalink to the given comment. 320 * 321 * @since 1.5.2 322 * 323 * @param string $string The current comment permalink returned by get_comment_link(). 324 */ 242 325 echo esc_url( apply_filters( 'comment_link', get_comment_link() ) ); 243 326 } 244 327 … … 254 337 * @return string Comment Author 255 338 */ 256 339 function get_comment_author_rss() { 340 /** 341 * Filter the current comment author for use in the feeds. 342 * 343 * @since 1.5.2 344 * 345 * @param string $string The current comment author returned by get_comment_author(). 346 */ 257 347 return apply_filters('comment_author_rss', get_comment_author() ); 258 348 } 259 349 … … 279 369 */ 280 370 function comment_text_rss() { 281 371 $comment_text = get_comment_text(); 372 /** 373 * Filter the current comment content for use in feeds. 374 * 375 * @since 1.5.2 376 * 377 * @param string $comment_text The comment content returned by get_comment_text(). 378 */ 282 379 $comment_text = apply_filters('comment_text_rss', $comment_text); 283 380 echo $comment_text; 284 381 } … … 329 426 $the_list .= "\t\t<category><![CDATA[" . @html_entity_decode( $cat_name, ENT_COMPAT, get_option('blog_charset') ) . "]]></category>\n"; 330 427 } 331 428 429 /** 430 * Filter all of the post categories for displaying in the feed. 431 * 432 * @since 2.2.0 433 * 434 * @param string $the_list All of the post categories for displaying in the feed. 435 * @param string $type Feed type returned by get_default_feed(), for example 'rss2', 'atom', etc. 436 */ 332 437 return apply_filters('the_category_rss', $the_list, $type); 333 438 } 334 439 … … 395 500 $t = preg_split('/[ \t]/', trim($enclosure[2]) ); 396 501 $type = $t[0]; 397 502 503 /** 504 * Filter the RSS enclosure HTML enclosure tag for the current post. 505 * 506 * @since 2.2.0 507 * 508 * @param string $string The link HTML tag with a URI and other attributes. 509 */ 398 510 echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . $type . '" />' . "\n"); 399 511 } 400 512 } … … 426 538 if ($key == 'enclosure') { 427 539 foreach ( (array) $val as $enc ) { 428 540 $enclosure = explode("\n", $enc); 541 /** 542 * Filter the atom enclosure HTML link tag for the current post. 543 * 544 * @since 2.2.0 545 * 546 * @param string $string The link HTML tag with a URI and other attributes. 547 */ 429 548 echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n"); 430 549 } 431 550 } … … 488 607 */ 489 608 function self_link() { 490 609 $host = @parse_url(home_url()); 610 /** 611 * Filter the feed URL. 612 * 613 * @since 3.6.0 614 * 615 * @param string $string The link for the feed with set scheme. 616 */ 491 617 echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ); 492 618 } 493 619 … … 512 638 513 639 $content_type = ( !empty($types[$type]) ) ? $types[$type] : 'application/octet-stream'; 514 640 641 /** 642 * Filter the feed content type. 643 * 644 * @since 2.8.0 645 * 646 * @param string $content_type Media type indicating the type of data that a feed contains. 647 * @param string $type Feed type returned by get_default_feed(), for example 'rss2', 'atom', etc. 648 */ 515 649 return apply_filters( 'feed_content_type', $content_type, $type ); 516 650 } 517 651 … … 541 675 542 676 $feed->set_feed_url( $url ); 543 677 $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) ); 678 /** 679 * Fires just before processing the SimplePie feed object. 680 * 681 * @since 3.0.0 682 * 683 * @param object &$feed SimplePie feed object, passed by reference. 684 * @param mixed $url URL of feed to retrieve. If an array of URLs, the feeds are merged. 685 */ 544 686 do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); 545 687 $feed->init(); 546 688 $feed->handle_content_type();
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)