]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/feed.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-includes / feed.php
index 560dc61ef74189d493b9a10408cd724c30b1da0d..f40f41a6ad79d40ec4d152ec80b6faf9a3717785 100644 (file)
@@ -71,7 +71,6 @@ function bloginfo_rss($show = '') {
  * 'default_feed' filter.
  *
  * @since 2.5.0
- * @uses apply_filters() Calls 'default_feed' hook on the default feed string.
  *
  * @return string Default feed, or for example 'rss2', 'atom', etc.
  */
@@ -165,7 +164,6 @@ function get_the_title_rss() {
  * Display the post title in the feed.
  *
  * @since 0.71
- * @uses get_the_title_rss() Used to retrieve current post title.
  */
 function the_title_rss() {
        echo get_the_title_rss();
@@ -203,8 +201,6 @@ function get_the_content_feed($feed_type = null) {
  * Display the post content for feeds.
  *
  * @since 2.9.0
- * @uses apply_filters() Calls 'the_content_feed' on the content before processing.
- * @see get_the_content()
  *
  * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
  */
@@ -280,7 +276,7 @@ function comment_guid($comment_id = null) {
  * @since 2.5.0
  *
  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
- * @return bool|string false on failure or guid for comment on success.
+ * @return false|string false on failure or guid for comment on success.
  */
 function get_comment_guid($comment_id = null) {
        $comment = get_comment($comment_id);
@@ -313,7 +309,6 @@ function comment_link() {
  * Retrieve the current comment author for use in the feeds.
  *
  * @since 2.0.0
- * @uses get_comment_author()
  *
  * @return string Comment Author
  */
@@ -343,7 +338,6 @@ function comment_author_rss() {
  * Display the current comment content for use in the feeds.
  *
  * @since 1.0.0
- * @uses get_comment_text()
  */
 function comment_text_rss() {
        $comment_text = get_comment_text();
@@ -454,7 +448,6 @@ function html_type_rss() {
  * attributes.
  *
  * @since 1.5.0
- * @uses get_post_custom() To get the current post enclosure metadata.
  */
 function rss_enclosure() {
        if ( post_password_required() )
@@ -494,7 +487,6 @@ function rss_enclosure() {
  * enclosure(s) consist of link HTML tag(s) with a URI and other attributes.
  *
  * @since 2.2.0
- * @uses get_post_custom() To get the current post enclosure metadata.
  */
 function atom_enclosure() {
        if ( post_password_required() )
@@ -553,13 +545,51 @@ function prep_atom_text_construct($data) {
                }
        }
 
-       if (strpos($data, ']]>') == false) {
+       if (strpos($data, ']]>') === false) {
                return array('html', "<![CDATA[$data]]>");
        } else {
                return array('html', htmlspecialchars($data));
        }
 }
 
+/**
+ * Displays Site Icon in atom feeds.
+ *
+ * @since 4.3.0
+ *
+ * @see get_site_icon_url()
+ */
+function atom_site_icon() {
+       $url = get_site_icon_url( 32 );
+       if ( $url ) {
+               echo "<icon>$url</icon>\n";
+       }
+}
+
+/**
+ * Displays Site Icon in RSS2.
+ *
+ * @since 4.3.0
+ */
+function rss2_site_icon() {
+       $rss_title = get_wp_title_rss();
+       if ( empty( $rss_title ) ) {
+               $rss_title = get_bloginfo_rss( 'name' );
+       }
+
+       $url = get_site_icon_url( 32 );
+       if ( $url ) {
+               echo '
+<image>
+       <url>' . convert_chars( $url ) . '</url>
+       <title>' . $rss_title . '</title>
+       <link>' . get_bloginfo_rss( 'url' ) . '</link>
+       <width>32</width>
+       <height>32</height>
+</image> ' . "\n";
+       }
+}
+
 /**
  * Display the link for the currently displayed feed in a XSS safe way.
  *
@@ -650,6 +680,7 @@ function fetch_feed( $url ) {
         */
        do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
        $feed->init();
+       $feed->set_output_encoding( get_option( 'blog_charset' ) );
        $feed->handle_content_type();
 
        if ( $feed->error() )