Title: WP-API JSON Feed
Author: Felix Arntz
Published: <strong>22 maijs, 2017</strong>
Last modified: 17 maijs, 2026

---

Meklēt spraudņus

![](https://ps.w.org/wp-api-json-feed/assets/banner-772x250.png?rev=2982096)

![](https://ps.w.org/wp-api-json-feed/assets/icon-256x256.png?rev=2982096)

# WP-API JSON Feed

 Autors [Felix Arntz](https://profiles.wordpress.org/flixos90/)

[Lejupielādēt](https://downloads.wordpress.org/plugin/wp-api-json-feed.1.1.0.zip)

 * [Sīkāka informācija](https://lv.wordpress.org/plugins/wp-api-json-feed/#description)
 * [Atsauksmes](https://lv.wordpress.org/plugins/wp-api-json-feed/#reviews)
 *  [Uzstādīšana](https://lv.wordpress.org/plugins/wp-api-json-feed/#installation)
 * [Attīstība](https://lv.wordpress.org/plugins/wp-api-json-feed/#developers)

 [Atbalsts](https://wordpress.org/support/plugin/wp-api-json-feed/)

## Apraksts

Implements JSON feeds following the official JSON feed specification by using the
WordPress REST API. By default, only a JSON feed for regular posts is added. This
can be easily customized to also provide JSON feeds for e.g. certain custom post
types.

 * Adds JSON feeds following the official [version 1.1 spec](https://jsonfeed.org/version/1.1).
 * Adds a JSON feed for posts to the REST API by default (e.g. at `/wp-json/feed/
   v1/posts`).
 * Allows adding JSON feeds for other post types by using a `show_json_feed` argument
   when registering the post type.
 * Places a link tag to the current feed inside the HTML head tag.
 * Maintains backward compatibility with the previous JSON feed [version 1 spec](https://www.jsonfeed.org/version/1/).
 * Contains extensive filters to modify the feed responses as necessary.

## Ekrānuzņēmumi

[⌊Example JSON feed response generated by the plugin⌉⌊Example JSON feed response
generated by the plugin⌉[

Example JSON feed response generated by the plugin

## Uzstādīšana

 1. Upload the entire `wp-api-json-feed` folder to the `/wp-content/plugins/` directory
    or download it through the WordPress backend.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.

#### Administration

Once the plugin is activated, it will work out of the box and provide a JSON feed
for posts. If you want to provide JSON feeds for further post types, you need to
specify an additional argument `show_json_feed` when registering the post type, 
and set it to a boolean `true`. You may also specify a `json_feed_base` argument
being a string identifier that should be used in the feed URL. If no string identifier
is provided, the post type slug will be used.

## BUJ

### How can I add a feed for my custom post type?

To provide a JSON feed for your custom post type, you need to specify an additional
argument `show_json_feed` when registering the post type, and set it to a boolean`
true`. You may optionally specify a `json_feed_base` argument being a string identifier
that should be used in the feed URL. If no string identifier is provided, the post
type slug will be used.

Here is an example, supporting a JSON feed for a custom post type “article” and 
setting its feed base to “articles” so that the feed will appear at `{restURL}/feed/
v1/articles`.

    ```
    <?php

    add_filter(
        'register_post_type_args',
        function ( $args, $post_type ) {
            if ( 'article' === $post_type ) {
                $args['show_json_feed'] = true;
                $args['json_feed_base'] = 'articles';
            }
            return $args;
        },
        10,
        2
    );
    ```

### Why does the JSON feed contain fields which are not part of the schema?

Since the JSON feed schema is always future compatible, by default the plugin preserves
backward compatibility with older JSON feed readers by maintaining deprecated fields
such as `author`. You can skip this backward compatibility behavior by using the`
wp_api_json_feed_skip_backward_compatibility` filter and returning `true`.

### Where should I submit my support request?

For regular support requests, please use the [wordpress.org support forums](https://wordpress.org/support/plugin/wp-api-json-feed).
If you have a technical issue with the plugin where you already have more insight
on how to fix it, you can also [open an issue on GitHub instead](https://github.com/felixarntz/wp-api-json-feed/issues).

### How can I contribute to the plugin?

If you have ideas to improve the plugin or to solve a bug, feel free to raise an
issue or submit a pull request in the [GitHub repository for the plugin](https://github.com/felixarntz/wp-api-json-feed).
Please stick to the [contributing guidelines](https://github.com/felixarntz/wp-api-json-feed/blob/main/CONTRIBUTING.md).

You can also contribute to the plugin by translating it. Simply visit [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/wp-api-json-feed)
to get started.

## Atsauksmes

Par šo spraudni nav atsauksmju.

## Autori un izstrādātāji

“WP-API JSON Feed” ir atvērtā pirmkoda programmatūra. Šo spraudni ir veidojuši šādi
cilvēki.

Līdzdalībnieki

 *   [ Felix Arntz ](https://profiles.wordpress.org/flixos90/)

[Tulkot “WP-API JSON Feed&#8221 savā valodā.](https://translate.wordpress.org/projects/wp-plugins/wp-api-json-feed)

### Vai jūs interesē attīstība?

[Pārlūkojiet kodu](https://plugins.trac.wordpress.org/browser/wp-api-json-feed/),
apmeklējiet[ SVN krātuvi ](https://plugins.svn.wordpress.org/wp-api-json-feed/)vai
abonējiet[ attīstības žurnālu](https://plugins.trac.wordpress.org/log/wp-api-json-feed/),
ko izveidojis [RSS](https://plugins.trac.wordpress.org/log/wp-api-json-feed/?limit=100&mode=stop_on_copy&format=rss).

## Izmaiņu žurnāls

#### 1.1.0

 * Added: Add support for the [JSON feed 1.1 spec](https://jsonfeed.org/version/1.1).
 * Added: Introduce filter `wp_api_json_feed_skip_backward_compatibility` to optionally
   skip JSON feed fields included for backward compatibility with [JSON feed 1.0 spec](https://jsonfeed.org/version/1).
 * Enhanced: Include a `<link>` tag for the most relevant JSON feed based on the
   current content, in addition to the general posts JSON feed.
 * Enhanced: Include a `user_comment` field in the JSON feeds.
 * Tweaked: Bump the minimum required WordPress and PHP versions.
 * Tweaked: Use modern test infrastructure including revised PHPUnit tests, and 
   GitHub Actions to ensure long-term stability.
 * Fixed: Remove unnecessary call to `load_plugin_textdomain()`.

#### 1.0.0

 * First stable version

## Meta

 *  Versija **1.1.0**
 *  Pēdējo reizi atjaunots: **pirms 3 mēnešiem**
 *  Aktīvās instalācijas: **70+**
 *  WordPress versija ** 5.4 vai jaunāka **
 *  Pārbaudīts līdz: **7.0.2**
 *  PHP versija ** 5.6 vai jaunāka **
 *  Valoda
 * [English (US)](https://wordpress.org/plugins/wp-api-json-feed/)
 * Birkas:
 * [feed](https://lv.wordpress.org/plugins/tags/feed/)[rest-api](https://lv.wordpress.org/plugins/tags/rest-api/)
 *  [Papildu skats](https://lv.wordpress.org/plugins/wp-api-json-feed/advanced/)

## Vērtējumi

Vēl nav iesniegta neviena atsauksme.

[Your review](https://wordpress.org/support/plugin/wp-api-json-feed/reviews/#new-post)

[Skatīt visas atsauksmes](https://wordpress.org/support/plugin/wp-api-json-feed/reviews/)

## Līdzdalībnieki

 *   [ Felix Arntz ](https://profiles.wordpress.org/flixos90/)

## Atbalsts

Jums ir kaut kas ko teikt? Vajadzīga palīdzība?

 [Skatīt atbalsta forumu](https://wordpress.org/support/plugin/wp-api-json-feed/)

## Ziedojiet

Vai vēlaties atbalstīt šī spraudņa pilnveidošanu?

 [ Ziedojiet šim spraudnim ](https://felix-arntz.me/wordpress-plugins/)