WordPress · Schema

PostInput

Input schema for creating or updating a post

CMSContent ManagementOpen SourceWordPress

Properties

Name Type Description
title string The title for the post
content string The content for the post
status string A named status for the post
excerpt string The excerpt for the post
author integer The ID for the author of the post
featured_media integer The ID of the featured media for the post
categories array The terms assigned in the category taxonomy
tags array The terms assigned in the post_tag taxonomy
View JSON Schema on GitHub

JSON Schema

wordpress-post-input-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/wordpress/refs/heads/main/json-schema/wordpress-post-input-schema.json",
  "title": "PostInput",
  "description": "Input schema for creating or updating a post",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "The title for the post",
      "example": "My New Post"
    },
    "content": {
      "type": "string",
      "description": "The content for the post",
      "example": "This is the post content."
    },
    "status": {
      "type": "string",
      "description": "A named status for the post",
      "enum": [
        "publish",
        "future",
        "draft",
        "pending",
        "private"
      ],
      "example": "publish"
    },
    "excerpt": {
      "type": "string",
      "description": "The excerpt for the post",
      "example": "A short excerpt"
    },
    "author": {
      "type": "integer",
      "description": "The ID for the author of the post",
      "example": 1
    },
    "featured_media": {
      "type": "integer",
      "description": "The ID of the featured media for the post",
      "example": 45
    },
    "categories": {
      "type": "array",
      "description": "The terms assigned in the category taxonomy",
      "items": {
        "type": "integer"
      },
      "example": [
        1
      ]
    },
    "tags": {
      "type": "array",
      "description": "The terms assigned in the post_tag taxonomy",
      "items": {
        "type": "integer"
      },
      "example": [
        12
      ]
    }
  }
}