Contents
On this page

Get Cuisine - Plugixa Recipe

GET /plugixa-recipe/v1/cuisines/{id}

Read one cuisine with its recipe count.

Needs a signed-in user who can open Plugixa Recipe: the plugixa_recipe_manage capability, or WordPress’s edit_posts (Contributor and up).

Request

GET https://your-site.example/wp-json/plugixa-recipe/v1/cuisines/5

Path parameters

Name Type Description
id integer The cuisine’s id

Responses

200 OK. data is the cuisine.

{
  "success": true,
  "message": "",
  "data": {
    "id": "5",
    "name": "Italian",
    "slug": "italian",
    "description": "Dishes from Italy.",
    "image_id": null,
    "display_order": "0",
    "language_code": "",
    "translation_group": "",
    "recipe_count": 6
  }
}
Field Type Meaning
data.id string The cuisine’s id
data.slug string Unique among cuisines
data.description string|null Plain text
data.image_id string|null Attachment id. image_url is added when set
data.display_order string Manual position
data.recipe_count integer Recipes linked to it, in any status
data.language_code, data.translation_group string|null For multilingual sites

Errors

Status Code When
404 rest_error No cuisine with that id.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-recipe/v1/cuisines/5" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/cuisines/5');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-recipe/v1/cuisines/5', {
  headers: {
    'Authorization': auth,
  },
});
const { data } = await response.json();

Quick Links

Share