Title: WP REST API &#8211; Pure Taxonomies
Author: Andrew MAGIK
Published: <strong>12 فوریه 2016</strong>
Last modified: 1 مارس 2016

---

جستجوی افزونه‌ها

این افزونه **با ۳ نگارش عمدهٔ اخیر وردپرس آزمایش نشده است**. ممکن است دیگر نگهداری
یا پشتیبانی نشود و هنگام استفاده با نگارش‌های تازه‌تر وردپرس مشکل سازگاری داشته 
باشد.

![](https://s.w.org/plugins/geopattern-icon/wp-rest-api-pure-taxonomies.svg)

# WP REST API – Pure Taxonomies

 توسط [Andrew MAGIK](https://profiles.wordpress.org/magikru/)

[دانلود](https://downloads.wordpress.org/plugin/wp-rest-api-pure-taxonomies.1.0.zip)

 * [جزئیات](https://fa.wordpress.org/plugins/wp-rest-api-pure-taxonomies/#description)
 * [نقد و بررسی‌ها](https://fa.wordpress.org/plugins/wp-rest-api-pure-taxonomies/#reviews)
 *  [نصب](https://fa.wordpress.org/plugins/wp-rest-api-pure-taxonomies/#installation)
 * [توسعه](https://fa.wordpress.org/plugins/wp-rest-api-pure-taxonomies/#developers)

 [پشتیبانی](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/)

## توضیحات

Now you have no need to make additional requests to get taxonomy info (term_id, 
name, slug, term_group, term_taxonomy_id, taxonomy, description, parent, count, 
filter) from their id that is available in the default json response.

Now all available taxonomy data is available in ‘pure_taxonomies’ field from your
json response. It works for all custom added taxonomies, and for custom post types.

For example in ‘wp-json/wp/v2/posts’ you can find default fields ‘categories’, ‘
tags’ and name of custom added taxonomies that contain only its id. With this plugin
you can also find new ‘pure_taxonomies’ field that include all available ‘categories’,‘
tags’ and custom taxonomies data.

**Before:**
 { … categories: [ 3 ], tags: [ 2 ], custom_taxonomy_name: [ 1 ] … }

**After:**
 { … pure_taxonomies: { categories: [ { term_id: 3, name: “First category”,
slug: “first-category”, term_group: 0, term_taxonomy_id: 3, taxonomy: “category”,
description: “”, parent: 0, count: 3, filter: “raw”, cat_ID: 3, category_count: 
3, category_description: “”, cat_name: “First category”, category_nicename: “first-
category”, category_parent: 0 } ], tags: [ { term_id: 2, name: “First tag”, slug:“
first-tag”, term_group: 0, term_taxonomy_id: 2, taxonomy: “post_tag”, description:“”,
parent: 0, count: 2, filter: “raw” } ], custom_taxonomy_name: [ { term_id: 1, name:“
Custom Taxonomy Name”, slug: “custom-taxonomy-name”, term_group: 0, term_taxonomy_id:
1, taxonomy: “custom_taxonomy_name”, description: “”, parent: 0, count: 1, filter:“
raw” } ] } … }

Check my other useful rest-api plugins: [https://wordpress.org/plugins/tags/andrew-magik-rest-api](https://wordpress.org/plugins/tags/andrew-magik-rest-api).

## نصب

 1. Double check you have the WordPress REST (v2) API installed and active
 2. Upload the plugin folder to the `/wp-content/plugins/` directory, or install the
    plugin through the WordPress plugins screen directly.
 3. Activate the plugin through the ‘Plugins’ screen in WordPress

## سوالات متداول

  How to add custom taxonomies into Rest API:

/**
 * Add REST API support to an already registered taxonomy. */ add_action( ‘init’,‘
my_custom_taxonomy_rest_support’, 25 ); function my_custom_taxonomy_rest_support(){
global $wp_taxonomies;

    ```
            //Here should be a list of names of the already created custom taxonomies:
            $taxonomy_names = array(
                'clients',
                'technologies'
            );
            foreach ( $taxonomy_names as $key => $taxonomy_name ) {
                if (isset($wp_taxonomies[$taxonomy_name])) {
                    $wp_taxonomies[$taxonomy_name]->show_in_rest = true;
                    $wp_taxonomies[$taxonomy_name]->rest_base = $taxonomy_name;
                    $wp_taxonomies[$taxonomy_name]->rest_controller_class = 'WP_REST_Terms_Controller';
                }
            }
        }
    ```

  How to add custom post type into Rest API:

/**
 * Add REST API support to an already registered post type. */ add_action( ‘
init’, ‘my_custom_post_type_rest_support’, 25 ); function my_custom_post_type_rest_support(){
global $wp_post_types;

    ```
            //Here should be a name of your already created custom post type:
            $post_type_name = 'portfolio';
            if( isset( $wp_post_types[ $post_type_name ] ) ) {
                $wp_post_types[$post_type_name]->show_in_rest = true;
                $wp_post_types[$post_type_name]->rest_base = $post_type_name;
                $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
            }
        }
    ```

  Do you have other useful REST-API plugins?

Yes, I have. You can check them by tag: [https://wordpress.org/plugins/tags/andrew-magik-rest-api](https://wordpress.org/plugins/tags/andrew-magik-rest-api).

## نقد و بررسی‌ها

![](https://secure.gravatar.com/avatar/5c64ac087df3347d1dd5fdad2f380c8c3be6d46bb04edea9ddd9c01e7d5161b0?
s=60&d=retro&r=g)

### 󠀁[Just works 🙂](https://wordpress.org/support/topic/just-works-412/)󠁿

 [dagvon](https://profiles.wordpress.org/dagvon/) 6 فوریه 2018

Works right out of the box.

![](https://secure.gravatar.com/avatar/c70d7c1ea2b886428ecd4299446b65ccd86c897ea82e6f87e5ba305cc1d745f9?
s=60&d=retro&r=g)

### 󠀁[PERFECT!](https://wordpress.org/support/topic/perfect-999/)󠁿

 [Rory Michael Heaney](https://profiles.wordpress.org/rorymheaney/) 8 اکتبر 2016

Works just as described and will save you a ton of time without having to make all
those additional API calls

![](https://secure.gravatar.com/avatar/3653998f953208943beccb2fe7242201cececa4afba98e13e918c1916faa6a66?
s=60&d=retro&r=g)

### 󠀁[very helpful function](https://wordpress.org/support/topic/very-helpful-function/)󠁿

 [jarnoschi](https://profiles.wordpress.org/jarnoschi/) 3 سپتامبر 2016

to directly access taxonomy details from GET posts. thanks for the work

![](https://secure.gravatar.com/avatar/95c9f4a1ec4059d5854b7d3618048694ff0476893dcecd28457dcef7784b5a8c?
s=60&d=retro&r=g)

### 󠀁[Works Perfectly](https://wordpress.org/support/topic/works-perfectly-822/)󠁿

 [David Massiani](https://profiles.wordpress.org/david-massiani/) 3 سپتامبر 2016

Good job!

![](https://secure.gravatar.com/avatar/c1da90711d6ac6219c1ec779788051ee00168b1ce6a970997cccc7f582eef62f?
s=60&d=retro&r=g)

### 󠀁[Very useful to reduce number of requests](https://wordpress.org/support/topic/very-useful-to-reduce-number-of-requests/)󠁿

 [Andrew MAGIK](https://profiles.wordpress.org/magikru/) 3 سپتامبر 2016

Very useful to reduce number of requests

 [ خواندن تمامی 5 نقد و بررسی‌ ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/)

## توسعه دهندگان و همکاران

“WP REST API – Pure Taxonomies” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت
کرده‌اند.

مشارکت کنندگان

 *   [ Andrew MAGIK ](https://profiles.wordpress.org/magikru/)

[ترجمه “WP REST API – Pure Taxonomies” به زبان شما.](https://translate.wordpress.org/projects/wp-plugins/wp-rest-api-pure-taxonomies)

### علاقه‌ مند به توسعه هستید؟

[کد را مرور کنید](https://plugins.trac.wordpress.org/browser/wp-rest-api-pure-taxonomies/)،
[مخزن SVN](https://plugins.svn.wordpress.org/wp-rest-api-pure-taxonomies/) را بررسی
کنید، یا از طریق [RSS](https://plugins.trac.wordpress.org/log/wp-rest-api-pure-taxonomies/?limit=100&mode=stop_on_copy&format=rss)
در [گزارش توسعه](https://plugins.trac.wordpress.org/log/wp-rest-api-pure-taxonomies/)
مشترک شوید.

## گزارش تغییرات

#### 1.0

 * Initial release!

## اطلاعات

 *  نگارش **1.0**
 *  آخرین به‌روزرسانی **11 سال پیش**
 *  نصب‌های فعال **400+**
 *  نگارش وردپرس ** 4.4 یا بالاتر **
 *  آزمایش‌شده تا **4.4.34**
 *  زبان
 * [English (US)](https://wordpress.org/plugins/wp-rest-api-pure-taxonomies/)
 * برچسب
 * [api](https://fa.wordpress.org/plugins/tags/api/)[categories](https://fa.wordpress.org/plugins/tags/categories/)
   [rest-api](https://fa.wordpress.org/plugins/tags/rest-api/)[taxonomies](https://fa.wordpress.org/plugins/tags/taxonomies/)
   [wp-api](https://fa.wordpress.org/plugins/tags/wp-api/)
 *  [نمایش پیشرفته](https://fa.wordpress.org/plugins/wp-rest-api-pure-taxonomies/advanced/)

## امتیازها

 5 از 5 ستاره.

 *  [  امتیاز 5 5-ستاره     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=5)
 *  [  امتیاز 0 4-ستاره     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=4)
 *  [  امتیاز 0 3-ستاره     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=3)
 *  [  امتیاز 0 2-ستاره     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=2)
 *  [  امتیاز 0 1-ستاره     ](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/?filter=1)

[بررسی شما](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/#new-post)

[مشاهدهٔ همهٔ بررسی‌ها](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/reviews/)

## مشارکت کنندگان

 *   [ Andrew MAGIK ](https://profiles.wordpress.org/magikru/)

## پشتیبانی

چیزی برای گفتن دارید؟ نیاز به کمک دارید؟

 [مشاهده انجمن پشتیبانی](https://wordpress.org/support/plugin/wp-rest-api-pure-taxonomies/)