Make WordPress Core

Ticket #25639: 25639.2.diff

File 25639.2.diff, 22.5 KB (added by pento, 12 years ago)
  • src/wp-includes/class-wp.php

     
    1515         * @access public
    1616         * @var array
    1717         */
    18         var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');
     18        var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'callback', 'pretty');
    1919
    2020        /**
    2121         * Private query variables.
  • src/wp-includes/default-filters.php

     
    237237add_action( 'do_feed_rss',                'do_feed_rss',                             10, 1 );
    238238add_action( 'do_feed_rss2',               'do_feed_rss2',                            10, 1 );
    239239add_action( 'do_feed_atom',               'do_feed_atom',                            10, 1 );
     240add_action( 'do_feed_as1',                'do_feed_as1',                             10, 1 );
     241add_action( 'do_feed_rssjs',              'do_feed_rssjs',                           10, 1 );
    240242add_action( 'do_pings',                   'do_all_pings',                            10, 1 );
    241243add_action( 'do_robots',                  'do_robots'                                      );
    242244add_action( 'set_comment_cookies',        'wp_set_comment_cookies',                  10, 2 );
  • src/wp-includes/feed-as1-comments.php

     
     1<?php
     2/**
     3 * Activity Streams 1 Feed Template for displaying AS1 Comments feed.
     4 *
     5 * @package WordPress
     6 * @subpackage Feed
     7 * @since 3.8.0
     8 */
     9
     10$json = new stdClass();
     11
     12$json->items = array();
     13
     14header( 'Content-Type: ' . feed_content_type( 'as1' ) . '; charset=' . get_option( 'blog_charset' ), true );
     15
     16/*
     17 * The JSONP callback function to add to the JSON feed
     18 *
     19 * @since 3.8.0
     20 *
     21 * @param string $callback The JSONP callback function name
     22 */
     23$callback = apply_filters( 'json_feed_callback', get_query_var( 'callback' ) );
     24
     25if ( ! empty( $callback ) && ! apply_filters( 'json_jsonp_enabled', true ) ) {
     26        status_header( 400 );
     27        echo json_encode( array(
     28                                                'code'    => 'json_callback_disabled',
     29                                                'message' => 'JSONP support is disabled on this site.'
     30                                        ) );
     31        exit;
     32}
     33
     34if ( preg_match( '/\W/', $callback ) ) {
     35        status_header( 400 );
     36        echo json_encode( array(
     37                                                'code'    => 'json_callback_invalid',
     38                                                'message' => 'The JSONP callback function is invalid.'
     39                                        ) );
     40        exit;
     41}
     42
     43/*
     44 * Action triggerd prior to the JSON feed being created and sent to the client
     45 *
     46 * @since 3.8.0
     47 */
     48do_action( 'json_feed_pre' );
     49
     50while( have_comments() ) {
     51        the_comment();
     52
     53        $comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
     54
     55        $item = array(
     56                        'published' => mysql2date( 'D, d M Y H:i:s +0000', get_comment_time( 'Y-m-d H:i:s', true, false ), false ),
     57                        'generator' => (object)array(
     58                                                        'url' => 'http://wordpress.org/?v=' . get_bloginfo( 'version' )
     59                                                ),
     60                        'provider' => (object)array(
     61                                                        'url' => get_feed_link( 'url' )
     62                                                ),
     63                        'verb' => 'post',
     64                        'target' => (object)array(
     65                                                'id'          => get_bloginfo( 'url' ),
     66                                                'url'         => get_bloginfo( 'url' ),
     67                                                'objectType'  => 'blog',
     68                                                'displayName' => get_bloginfo( 'name' )
     69                                        ),
     70                        'object' => (object)array(
     71                                                'id'          => get_comment_guid(),
     72                                                'objectType'  => 'comment',
     73                                                'url'         => get_comment_link()
     74                                        ),
     75                        'actor' => (object)array(
     76                                                'id'          => get_comment_author_url(),
     77                                                'displayName' => get_comment_author(),
     78                                                'objectType'  => 'person',
     79                                                'url'         => get_comment_author_url(),
     80                                                'image'       => (object)array(
     81                                                                                        'width'  => 96,
     82                                                                                        'height' => 96,
     83                                                                                        // TODO: get_avatar_url()
     84                                                                                        'url'    => 'http://www.gravatar.com/avatar/' . md5( get_comment_author_email() ) . '.png?s=96'
     85                                                                                )
     86                                        )
     87                        );
     88
     89        if ( post_password_required($comment_post) ) {
     90                $item['object']->summary = __( 'Protected Comments: Please enter your password to view comments.' );
     91                $item['object']->content = get_the_password_form();
     92        } else {
     93                $item['object']->summary = get_comment_text();
     94                $item['object']->content = get_comment_text();
     95        }
     96
     97        /*
     98         * The item to be added to the Activity Streams 1 Comment feed
     99         *
     100         * @since 3.8.0
     101         *
     102         * @param object $item The Activity Streams 1 Comment item
     103         */
     104        $item = apply_filters( 'comment_as1_feed_item', $item );
     105
     106        $json->items[] = $item;
     107}
     108
     109/*
     110 * The array of data to be sent to the user as JSON
     111 *
     112 * @since 3.8.0
     113 *
     114 * @param object $json The JSON data object
     115 */
     116$json = apply_filters( 'comment_as1_feed', $json );
     117
     118if ( version_compare( phpversion(), '5.3.0', '<' ) ) {
     119        // json_encode() options added in PHP 5.3
     120        $json_str = json_encode( $json );
     121} else {
     122        $options = 0;
     123        // JSON_PRETTY_PRINT added in PHP 5.4
     124        if ( get_query_var( 'pretty' ) && version_compare( phpversion(), '5.4.0', '>=' ) )
     125                $options |= JSON_PRETTY_PRINT;
     126
     127        /*
     128         * Options to be passed to json_encode()
     129         *
     130         * @since 3.8.0
     131         *
     132         * @param int $options The current options flags
     133         */
     134        $options = apply_filters( 'json_feed_options', $options );
     135
     136        $json_str = json_encode( $json, $options );
     137}
     138
     139if ( ! empty( $callback ) )
     140        echo "$callback( $json_str );";
     141else
     142        echo $json_str;
     143
     144/*
     145 * Action triggerd after the JSON feed has been created and sent to the client
     146 *
     147 * @since 3.8.0
     148 */
     149do_action( 'json_feed_post' );
  • src/wp-includes/feed-as1.php

     
     1<?php
     2/**
     3 * Activity Streams 1 Feed Template for displaying AS1 Posts feed.
     4 *
     5 * @package WordPress
     6 * @subpackage Feed
     7 * @since 3.8.0
     8 */
     9
     10$json = new stdClass();
     11
     12$json->items = array();
     13
     14header( 'Content-Type: ' . feed_content_type( 'as1' ) . '; charset=' . get_option( 'blog_charset' ), true );
     15
     16/*
     17 * The JSONP callback function to add to the JSON feed
     18 *
     19 * @since 3.8.0
     20 *
     21 * @param string $callback The JSONP callback function name
     22 */
     23$callback = apply_filters( 'json_feed_callback', get_query_var( 'callback' ) );
     24
     25if ( ! empty( $callback ) && ! apply_filters( 'json_jsonp_enabled', true ) ) {
     26        status_header( 400 );
     27        echo json_encode( array(
     28                                                'code'    => 'json_callback_disabled',
     29                                                'message' => 'JSONP support is disabled on this site.'
     30                                        ) );
     31        exit;
     32}
     33
     34if ( preg_match( '/\W/', $callback ) ) {
     35        status_header( 400 );
     36        echo json_encode( array(
     37                                                'code'    => 'json_callback_invalid',
     38                                                'message' => 'The JSONP callback function is invalid.'
     39                                        ) );
     40        exit;
     41}
     42
     43/*
     44 * Action triggerd prior to the JSON feed being created and sent to the client
     45 *
     46 * @since 3.8.0
     47 */
     48do_action( 'json_feed_pre' );
     49
     50while( have_posts() ) {
     51        the_post();
     52
     53        $post_type = get_post_type();
     54        switch ( $post_type ) {
     55                case "post":
     56                        $post_format = get_post_format();
     57                        switch ( $post_format ) {
     58                                case "aside":
     59                                case "status":
     60                                case "quote":
     61                                case "note":
     62                                        $object_type = "note";
     63                                        break;
     64                                case "gallery":
     65                                case "image":
     66                                        $object_type = "image";
     67                                        break;
     68                                case "video":
     69                                        $object_type = "video";
     70                                        break;
     71                                case "audio":
     72                                        $object_type = "audio";
     73                                        break;
     74                                default:
     75                                        $object_type = "article";
     76                                        break;
     77                        }
     78                        break;
     79                case "page":
     80                        $object_type = "page";
     81                        break;
     82                case "attachment":
     83                        $mime_type = get_post_mime_type();
     84                        $media_type = preg_replace("/(\/[a-zA-Z]+)/i", "", $mime_type);
     85
     86                        switch ($media_type) {
     87                                case 'audio':
     88                                        $object_type = "audio";
     89                                        break;
     90                                case 'video':
     91                                        $object_type = "video";
     92                                        break;
     93                                case 'image':
     94                                        $object_type = "image";
     95                                        break;
     96                        }
     97                        break;
     98                default:
     99                        $object_type = "article";
     100                        break;
     101        }
     102
     103        /*
     104         * The object type of the current post in the Activity Streams 1 feed
     105         *
     106         * @since 3.8.0
     107         *
     108         * @param string $object_type The current object type
     109         * @param string $post_type The current post type
     110         */
     111        $object_type = apply_filters( 'as1_object_type', $object_type, $post_type );
     112
     113        $item = array(
     114                        'published' => mysql2date( 'D, d M Y H:i:s +0000', get_post_modified_time( 'Y-m-d\TH:i:s\Z', true ), false ),
     115                        'generator' => (object)array(
     116                                                        'url' => 'http://wordpress.org/?v=' . get_bloginfo( 'version' )
     117                                                ),
     118                        'provider' => (object)array(
     119                                                        'url' => get_feed_link( 'url' )
     120                                                ),
     121                        'verb' => 'post',
     122                        'target' => (object)array(
     123                                                'id'          => get_bloginfo( 'url' ),
     124                                                'url'         => get_bloginfo( 'url' ),
     125                                                'objectType'  => 'blog',
     126                                                'displayName' => get_bloginfo( 'name' )
     127                                        ),
     128                        'object' => (object)array(
     129                                                'id'          => get_the_guid(),
     130                                                'displayName' => get_the_title(),
     131                                                'objectType'  => $object_type,
     132                                                'summary'     => get_the_excerpt(),
     133                                                'url'         => get_permalink(),
     134                                                'content'     => get_the_content()
     135                                        ),
     136                        'actor' => (object)array(
     137                                                'id'          => get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'nicename' ) ),
     138                                                'displayName' => get_the_author(),
     139                                                'objectType'  => 'person',
     140                                                'url'         => get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'nicename' ) ),
     141                                                'image'       => (object)array(
     142                                                                                        'width'  => 96,
     143                                                                                        'height' => 96,
     144                                                                                        // TODO: get_avatar_url()
     145                                                                                        'url'    => 'http://www.gravatar.com/avatar/' . md5( get_the_author_meta( 'email' ) ) . '.png?s=96'
     146                                                                                )
     147                                        )
     148                        );
     149
     150        /*
     151         * The item to be added to the Activity Streams 1 Post feed
     152         *
     153         * @since 3.8.0
     154         *
     155         * @param object $item The Activity Streams 1 Post item
     156         */
     157        $item = apply_filters( 'as1_feed_item', $item );
     158
     159        $json->items[] = $item;
     160}
     161
     162/*
     163 * The array of data to be sent to the user as JSON
     164 *
     165 * @since 3.8.0
     166 *
     167 * @param object $json The JSON data object
     168 */
     169$json = apply_filters( 'as1_feed', $json );
     170
     171if ( version_compare( phpversion(), '5.3.0', '<' ) ) {
     172        // json_encode() options added in PHP 5.3
     173        $json_str = json_encode( $json );
     174} else {
     175        $options = 0;
     176        // JSON_PRETTY_PRINT added in PHP 5.4
     177        if ( get_query_var( 'pretty' ) && version_compare( phpversion(), '5.4.0', '>=' ) )
     178                $options |= JSON_PRETTY_PRINT;
     179
     180        /*
     181         * Options to be passed to json_encode()
     182         *
     183         * @since 3.8.0
     184         *
     185         * @param int $options The current options flags
     186         */
     187        $options = apply_filters( 'json_feed_options', $options );
     188
     189        $json_str = json_encode( $json, $options );
     190}
     191
     192if ( ! empty( $callback ) )
     193        echo "$callback( $json_str );";
     194else
     195        echo $json_str;
     196
     197/*
     198 * Action triggerd after the JSON feed has been created and sent to the client
     199 *
     200 * @since 3.8.0
     201 */
     202do_action( 'json_feed_post' );
  • src/wp-includes/feed-rssjs-comments.php

     
     1<?php
     2/**
     3 * rss.js Feed Template for displaying rss.js Comments feed.
     4 *
     5 * @package WordPress
     6 * @subpackage Feed
     7 * @since 3.8.0
     8 */
     9
     10$json = new stdClass();
     11$json->rss = new stdClass();
     12
     13$json->rss->version = "2.0";
     14$json->rss->channel = new stdClass();
     15
     16if ( is_singular() )
     17        $json->rss->channel->title = sprintf( __( 'Comments on: %s' ), get_the_title() );
     18elseif ( is_search() )
     19        $json->rss->channel->title = sprintf( __( 'Comments for %1$s searching on %2$s' ), get_bloginfo( 'name' ), get_search_query() );
     20else
     21        $json->rss->channel->title = sprintf( __( 'Comments for %s' ), get_bloginfo( 'name' ) . get_the_title() );
     22
     23$json->rss->channel->link          = get_bloginfo( 'url' );
     24$json->rss->channel->description   = get_bloginfo( 'description' );
     25$json->rss->channel->language      = get_bloginfo( 'language' );
     26$json->rss->channel->lastBuildDate = mysql2date( 'D, d M Y H:i:s +0000', get_lastcommentmodified( 'GMT' ), false );
     27$json->rss->channel->docs          = "http://cyber.law.harvard.edu/rss/rss.html";
     28$json->rss->channel->generator     = 'WordPress ' . get_bloginfo( 'version' );
     29$json->rss->channel->ttl           = 15;
     30
     31$json->rss->channel->item = array();
     32
     33header( 'Content-Type: ' . feed_content_type( 'rssjs' ) . '; charset=' . get_option( 'blog_charset' ), true );
     34
     35/*
     36 * The JSONP callback function to add to the JSON feed
     37 *
     38 * @since 3.8.0
     39 *
     40 * @param string $callback The JSONP callback function name
     41 */
     42$callback = apply_filters( 'json_feed_callback', get_query_var( 'callback' ) );
     43
     44if ( ! empty( $callback ) && ! apply_filters( 'json_jsonp_enabled', true ) ) {
     45        status_header( 400 );
     46        echo json_encode( array(
     47                                                'code'    => 'json_callback_disabled',
     48                                                'message' => 'JSONP support is disabled on this site.'
     49                                        ) );
     50        exit;
     51}
     52
     53if ( preg_match( '/\W/', $callback ) ) {
     54        status_header( 400 );
     55        echo json_encode( array(
     56                                                'code'    => 'json_callback_invalid',
     57                                                'message' => 'The JSONP callback function is invalid.'
     58                                        ) );
     59        exit;
     60}
     61
     62/*
     63 * Action triggerd prior to the JSON feed being created and sent to the client
     64 *
     65 * @since 3.8.0
     66 */
     67do_action( 'json_feed_pre' );
     68
     69while( have_comments() ) {
     70        the_comment();
     71
     72        $comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
     73
     74        $item = new stdClass();
     75
     76        if ( !is_singular() ) {
     77                $title = get_the_title( $comment_post->ID );
     78                $item->title = sprintf( __('Comment on %1$s by %2$s') , $title, get_comment_author() );
     79        } else {
     80                $item->title = sprintf( __('By: %s'), get_comment_author() );
     81        }
     82
     83        $item->link        = get_comment_link();
     84        $item->guid        = get_comment_guid();
     85        $item->pubDate     = mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false );
     86
     87        if ( post_password_required($comment_post) )
     88                $item->description = __( 'Protected Comments: Please enter your password to view comments.' );
     89        else
     90                $item->description = get_comment_text();
     91        /*
     92         * The item to be added to the rss.js Comment feed
     93         *
     94         * @since 3.8.0
     95         *
     96         * @param object $item The rss.js Comment item
     97         */
     98        $item = apply_filters( 'comment_rssjs_feed_item', $item );
     99
     100        $json->rss->channel->item[] = $item;
     101}
     102
     103/*
     104 * The data to be sent to the user as JSON
     105 *
     106 * @since 3.8.0
     107 *
     108 * @param object $json The JSON data object
     109 */
     110$json = apply_filters( 'comment_rssjs_feed', $json );
     111
     112if ( version_compare( phpversion(), '5.3.0', '<' ) ) {
     113        // json_encode() options added in PHP 5.3
     114        $json_str = json_encode( $json );
     115} else {
     116        $options = 0;
     117        // JSON_PRETTY_PRINT added in PHP 5.4
     118        if ( get_query_var( 'pretty' ) && version_compare( phpversion(), '5.4.0', '>=' ) )
     119                $options |= JSON_PRETTY_PRINT;
     120
     121        /*
     122         * Options to be passed to json_encode()
     123         *
     124         * @since 3.8.0
     125         *
     126         * @param int $options The current options flags
     127         */
     128        $options = apply_filters( 'json_feed_options', $options );
     129
     130        $json_str = json_encode( $json, $options );
     131}
     132
     133if ( ! empty( $callback ) )
     134        echo "$callback( $json_str );";
     135else
     136        echo $json_str;
     137
     138/*
     139 * Action triggerd after the JSON feed has been created and sent to the client
     140 *
     141 * @since 3.8.0
     142 */
     143do_action( 'json_feed_post' );
  • src/wp-includes/feed-rssjs.php

     
     1<?php
     2/**
     3 * rss.js Feed Template for displaying rss.js Posts feed.
     4 *
     5 * @package WordPress
     6 * @subpackage Feed
     7 * @since 3.8.0
     8 */
     9
     10$json = new stdClass();
     11$json->rss = new stdClass();
     12
     13$json->rss->version = "2.0";
     14$json->rss->channel = new stdClass();
     15
     16$json->rss->channel->title         = get_bloginfo( 'name' );
     17$json->rss->channel->link          = get_bloginfo( 'url' );
     18$json->rss->channel->description   = get_bloginfo( 'description' );
     19$json->rss->channel->language      = get_bloginfo( 'language' );
     20$json->rss->channel->lastBuildDate = mysql2date( 'D, d M Y H:i:s +0000', get_lastpostmodified( 'GMT' ), false );
     21$json->rss->channel->docs          = "http://cyber.law.harvard.edu/rss/rss.html";
     22$json->rss->channel->generator     = 'WordPress ' . get_bloginfo( 'version' );
     23$json->rss->channel->ttl           = 15;
     24
     25$json->rss->channel->item = array();
     26
     27header( 'Content-Type: ' . feed_content_type( 'rssjs' ) . '; charset=' . get_option( 'blog_charset' ), true );
     28
     29/*
     30 * The JSONP callback function to add to the JSON feed
     31 *
     32 * @since 3.8.0
     33 *
     34 * @param string $callback The JSONP callback function name
     35 */
     36$callback = apply_filters( 'json_feed_callback', get_query_var( 'callback' ) );
     37
     38if ( ! empty( $callback ) && ! apply_filters( 'json_jsonp_enabled', true ) ) {
     39        status_header( 400 );
     40        echo json_encode( array(
     41                                                'code'    => 'json_callback_disabled',
     42                                                'message' => 'JSONP support is disabled on this site.'
     43                                        ) );
     44        exit;
     45}
     46
     47if ( preg_match( '/\W/', $callback ) ) {
     48        status_header( 400 );
     49        echo json_encode( array(
     50                                                'code'    => 'json_callback_invalid',
     51                                                'message' => 'The JSONP callback function is invalid.'
     52                                        ) );
     53        exit;
     54}
     55
     56/*
     57 * Action triggerd prior to the JSON feed being created and sent to the client
     58 *
     59 * @since 3.8.0
     60 */
     61do_action( 'json_feed_pre' );
     62
     63while( have_posts() ) {
     64        the_post();
     65
     66        $item = new stdClass();
     67
     68        $item->title       = get_the_title();
     69        $item->link        = get_permalink();
     70        $item->guid        = get_the_guid();
     71        $item->description = get_the_content();
     72        $item->pubDate     = mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false );
     73
     74        /*
     75         * The item to be added to the rss.js Post feed
     76         *
     77         * @since 3.8.0
     78         *
     79         * @param object $item The rss.js Post item
     80         */
     81        $item = apply_filters( 'rssjs_feed_item', $item );
     82
     83        $json->rss->channel->item[] = $item;
     84}
     85
     86/*
     87 * The data to be sent to the user as JSON
     88 *
     89 * @since 3.8.0
     90 *
     91 * @param object $json The JSON data object
     92 */
     93$json = apply_filters( 'rssjs_feed', $json );
     94
     95if ( version_compare( phpversion(), '5.3.0', '<' ) ) {
     96        // json_encode() options added in PHP 5.3
     97        $json_str = json_encode( $json );
     98} else {
     99        $options = 0;
     100        // JSON_PRETTY_PRINT added in PHP 5.4
     101        if ( get_query_var( 'pretty' ) && version_compare( phpversion(), '5.4.0', '>=' ) )
     102                $options |= JSON_PRETTY_PRINT;
     103
     104        /*
     105         * Options to be passed to json_encode()
     106         *
     107         * @since 3.8.0
     108         *
     109         * @param int $options The current options flags
     110         */
     111        $options = apply_filters( 'json_feed_options', $options );
     112
     113        $json_str = json_encode( $json, $options );
     114}
     115
     116if ( ! empty( $callback ) )
     117        echo "$callback( $json_str );";
     118else
     119        echo $json_str;
     120
     121/*
     122 * Action triggerd after the JSON feed has been created and sent to the client
     123 *
     124 * @since 3.8.0
     125 */
     126do_action( 'json_feed_post' );
  • src/wp-includes/feed.php

     
    507507                'rss2' => 'application/rss+xml',
    508508                'rss-http'  => 'text/xml',
    509509                'atom' => 'application/atom+xml',
    510                 'rdf'  => 'application/rdf+xml'
     510                'rdf'  => 'application/rdf+xml',
     511                'as1'  => 'application/stream+json',
     512                'rssjs' => 'application/rss+json'
    511513        );
    512514
    513515        $content_type = ( !empty($types[$type]) ) ? $types[$type] : 'application/octet-stream';
  • src/wp-includes/functions.php

     
    10831083}
    10841084
    10851085/**
     1086 * Load either Activity Streams 1 comment feed or Activity Streams posts feed.
     1087 *
     1088 * @since 3.8.0
     1089 *
     1090 * @param bool $for_comments True for the comment feed, false for normal feed.
     1091 */
     1092function do_feed_as1( $for_comments ) {
     1093        if ($for_comments)
     1094                load_template( ABSPATH . WPINC . '/feed-as1-comments.php');
     1095        else
     1096                load_template( ABSPATH . WPINC . '/feed-as1.php' );
     1097}
     1098
     1099/**
     1100 * Load either rssjs comment feed or rssjs posts feed.
     1101 *
     1102 * @since 3.8.0
     1103 *
     1104 * @param bool $for_comments True for the comment feed, false for normal feed.
     1105 */
     1106function do_feed_rssjs( $for_comments ) {
     1107        if ($for_comments)
     1108                load_template( ABSPATH . WPINC . '/feed-rssjs-comments.php');
     1109        else
     1110                load_template( ABSPATH . WPINC . '/feed-rssjs.php' );
     1111}
     1112
     1113/**
    10861114 * Display the robots.txt file content.
    10871115 *
    10881116 * The echo content should be with usage of the permalinks or for creating the
  • src/wp-includes/general-template.php

     
    477477                case 'comments_rss2_url':
    478478                        $output = get_feed_link('comments_rss2');
    479479                        break;
     480                case 'as1_url':
     481                        $output = get_feed_link('as1');
     482                        break;
     483                case 'comments_as1_url':
     484                        $output = get_feed_link('comments_as1');
     485                        break;
     486                case 'rssjs_url':
     487                        $output = get_feed_link('rssjs');
     488                        break;
     489                case 'comments_atom_url':
     490                        $output = get_feed_link('comments_rssjs');
     491                        break;
    480492                case 'pingback_url':
    481493                        $output = site_url( 'xmlrpc.php' );
    482494                        break;
  • src/wp-includes/rewrite.php

     
    743743         * @access private
    744744         * @var array
    745745         */
    746         var $feeds = array( 'feed', 'rdf', 'rss', 'rss2', 'atom' );
     746        var $feeds = array( 'feed', 'rdf', 'rss', 'rss2', 'atom', 'as1', 'rssjs' );
    747747
    748748        /**
    749749         * Whether permalinks are being used.