Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args1 = array(
- 'type' => 'string',
- 'description' => 'Published Date',
- 'single' => true,
- 'show_in_rest' => true
- );
- register_meta( 'post', 'book_publish_date', $args1 );
- $args1 = array(
- 'type' => 'string',
- 'description' => 'Published Date',
- 'single' => true,
- 'show_in_rest' => true
- );
- register_meta( 'book', 'book_publish_date', $args1 );
- function create_book_author() {
- $labels = array(
- 'name' => 'Identifiers',
- 'singular_name' => 'Identifier',
- 'menu_name' => 'Book Identifiers',
- 'all_items' => 'All Identifiers',
- 'parent_item' => 'Parent Identifier',
- 'parent_item_colon' => 'Parent Identifier:',
- 'new_item_name' => 'New Identifier Name',
- 'add_new_item' => 'Add New Identifier',
- 'edit_item' => 'Edit Identifier',
- 'update_item' => 'Update Identifier',
- 'view_item' => 'View Identifier',
- 'separate_items_with_commas' => 'Separate Identifiers with commas',
- 'add_or_remove_items' => 'Add or remove Identifiers',
- 'choose_from_most_used' => 'Choose from the most used',
- 'popular_items' => 'Popular Identifiers',
- 'search_items' => 'Search Identifiers',
- 'not_found' => 'Not Found',
- 'no_terms' => 'No Identifiers',
- 'items_list' => 'Identifiers list',
- 'items_list_navigation' => 'Identifiers list navigation',
- );
- $rewrite = array(
- 'slug' => 'bookid',
- 'with_front' => true,
- 'hierarchical' => false,
- );
- $args = array(
- 'labels' => $labels,
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_admin_column' => false,
- 'show_in_nav_menus' => true,
- 'show_tagcloud' => true,
- 'rewrite' => $rewrite,
- 'show_in_rest' => true,
- 'rest_base' => 'identifiers',
- );
- register_taxonomy( 'book_id', array( 'book' ), $args );
- {
- "namespace": "wp/v2",
- "methods": [
- "GET",
- "POST"
- ],
- "endpoints": [
- {
- "methods": [
- "GET"
- ],
- "args": {
- "context": {
- "required": false,
- "default": "view",
- "enum": [
- "view",
- "embed",
- "edit"
- ],
- "description": "Scope under which the request is made; determines fields present in response.",
- "type": "string"
- },
- "page": {
- "required": false,
- "default": 1,
- "description": "Current page of the collection.",
- "type": "integer"
- },
- "per_page": {
- "required": false,
- "default": 10,
- "description": "Maximum number of items to be returned in result set.",
- "type": "integer"
- },
- "search": {
- "required": false,
- "description": "Limit results to those matching a string.",
- "type": "string"
- },
- "after": {
- "required": false,
- "description": "Limit response to posts published after a given ISO8601 compliant date.",
- "type": "string"
- },
- "before": {
- "required": false,
- "description": "Limit response to posts published before a given ISO8601 compliant date.",
- "type": "string"
- },
- "exclude": {
- "required": false,
- "default": [
- ],
- "description": "Ensure result set excludes specific IDs.",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "include": {
- "required": false,
- "default": [
- ],
- "description": "Limit result set to specific IDs.",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "offset": {
- "required": false,
- "description": "Offset the result set by a specific number of items.",
- "type": "integer"
- },
- "order": {
- "required": false,
- "default": "desc",
- "enum": [
- "asc",
- "desc"
- ],
- "description": "Order sort attribute ascending or descending.",
- "type": "string"
- },
- "orderby": {
- "required": false,
- "default": "date",
- "enum": [
- "author",
- "date",
- "id",
- "include",
- "modified",
- "parent",
- "relevance",
- "slug",
- "include_slugs",
- "title"
- ],
- "description": "Sort collection by object attribute.",
- "type": "string"
- },
- "slug": {
- "required": false,
- "description": "Limit result set to posts with one or more specific slugs.",
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "status": {
- "required": false,
- "default": "publish",
- "description": "Limit result set to posts assigned one or more statuses.",
- "type": "array",
- "items": {
- "enum": [
- "publish",
- "future",
- "draft",
- "pending",
- "private",
- "trash",
- "auto-draft",
- "inherit",
- "any"
- ],
- "type": "string"
- }
- },
- "authors": {
- "required": false,
- "default": [
- ],
- "description": "Limit result set to all items that have the specified term assigned in the authors taxonomy.",
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "authors_exclude": {
- "required": false,
- "default": [
- ],
- "description": "Limit result set to all items except those that have the specified term assigned in the authors taxonomy.",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- },
- {
- "methods": [
- "POST"
- ],
- "args": {
- "date": {
- "required": false,
- "description": "The date the object was published, in the site's timezone.",
- "type": "string"
- },
- "date_gmt": {
- "required": false,
- "description": "The date the object was published, as GMT.",
- "type": "string"
- },
- "slug": {
- "required": false,
- "description": "An alphanumeric identifier for the object unique to its type.",
- "type": "string"
- },
- "status": {
- "required": false,
- "enum": [
- "publish",
- "future",
- "draft",
- "pending",
- "private"
- ],
- "description": "A named status for the object.",
- "type": "string"
- },
- "password": {
- "required": false,
- "description": "A password to protect access to the content and excerpt.",
- "type": "string"
- },
- "title": {
- "required": false,
- "description": "The title for the object.",
- "type": "object"
- },
- "content": {
- "required": false,
- "description": "The content for the object.",
- "type": "object"
- },
- "excerpt": {
- "required": false,
- "description": "The excerpt for the object.",
- "type": "object"
- },
- "comment_status": {
- "required": false,
- "enum": [
- "open",
- "closed"
- ],
- "description": "Whether or not comments are open on the object.",
- "type": "string"
- },
- "ping_status": {
- "required": false,
- "enum": [
- "open",
- "closed"
- ],
- "description": "Whether or not the object can be pinged.",
- "type": "string"
- },
- "meta": {
- "required": false,
- "description": "Meta fields.",
- "type": "object"
- },
- "template": {
- "required": false,
- "description": "The theme file to use to display the object.",
- "type": "string"
- },
- "authors": {
- "required": false,
- "description": "The terms assigned to the object in the book_id taxonomy.",
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- }
- }
- ],
- "schema": {
- "$schema": "http://json-schema.org/draft-04/schema#",
- "title": "book",
- "type": "object",
- "properties": {
- "date": {
- "description": "The date the object was published, in the site's timezone.",
- "type": "string",
- "format": "date-time",
- "context": [
- "view",
- "edit",
- "embed"
- ]
- },
- "date_gmt": {
- "description": "The date the object was published, as GMT.",
- "type": "string",
- "format": "date-time",
- "context": [
- "view",
- "edit"
- ]
- },
- "guid": {
- "description": "The globally unique identifier for the object.",
- "type": "object",
- "context": [
- "view",
- "edit"
- ],
- "readonly": true,
- "properties": {
- "raw": {
- "description": "GUID for the object, as it exists in the database.",
- "type": "string",
- "context": [
- "edit"
- ],
- "readonly": true
- },
- "rendered": {
- "description": "GUID for the object, transformed for display.",
- "type": "string",
- "context": [
- "view",
- "edit"
- ],
- "readonly": true
- }
- }
- },
- "id": {
- "description": "Unique identifier for the object.",
- "type": "integer",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "readonly": true
- },
- "link": {
- "description": "URL to the object.",
- "type": "string",
- "format": "uri",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "readonly": true
- },
- "modified": {
- "description": "The date the object was last modified, in the site's timezone.",
- "type": "string",
- "format": "date-time",
- "context": [
- "view",
- "edit"
- ],
- "readonly": true
- },
- "modified_gmt": {
- "description": "The date the object was last modified, as GMT.",
- "type": "string",
- "format": "date-time",
- "context": [
- "view",
- "edit"
- ],
- "readonly": true
- },
- "slug": {
- "description": "An alphanumeric identifier for the object unique to its type.",
- "type": "string",
- "context": [
- "view",
- "edit",
- "embed"
- ]
- },
- "status": {
- "description": "A named status for the object.",
- "type": "string",
- "enum": [
- "publish",
- "future",
- "draft",
- "pending",
- "private"
- ],
- "context": [
- "view",
- "edit"
- ]
- },
- "type": {
- "description": "Type of Post for the object.",
- "type": "string",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "readonly": true
- },
- "password": {
- "description": "A password to protect access to the content and excerpt.",
- "type": "string",
- "context": [
- "edit"
- ]
- },
- "title": {
- "description": "The title for the object.",
- "type": "object",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "properties": {
- "raw": {
- "description": "Title for the object, as it exists in the database.",
- "type": "string",
- "context": [
- "edit"
- ]
- },
- "rendered": {
- "description": "HTML title for the object, transformed for display.",
- "type": "string",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "readonly": true
- }
- }
- },
- "content": {
- "description": "The content for the object.",
- "type": "object",
- "context": [
- "view",
- "edit"
- ],
- "properties": {
- "raw": {
- "description": "Content for the object, as it exists in the database.",
- "type": "string",
- "context": [
- "edit"
- ]
- },
- "rendered": {
- "description": "HTML content for the object, transformed for display.",
- "type": "string",
- "context": [
- "view",
- "edit"
- ],
- "readonly": true
- },
- "protected": {
- "description": "Whether the content is protected with a password.",
- "type": "boolean",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "readonly": true
- }
- }
- },
- "excerpt": {
- "description": "The excerpt for the object.",
- "type": "object",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "properties": {
- "raw": {
- "description": "Excerpt for the object, as it exists in the database.",
- "type": "string",
- "context": [
- "edit"
- ]
- },
- "rendered": {
- "description": "HTML excerpt for the object, transformed for display.",
- "type": "string",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "readonly": true
- },
- "protected": {
- "description": "Whether the excerpt is protected with a password.",
- "type": "boolean",
- "context": [
- "view",
- "edit",
- "embed"
- ],
- "readonly": true
- }
- }
- },
- "comment_status": {
- "description": "Whether or not comments are open on the object.",
- "type": "string",
- "enum": [
- "open",
- "closed"
- ],
- "context": [
- "view",
- "edit"
- ]
- },
- "ping_status": {
- "description": "Whether or not the object can be pinged.",
- "type": "string",
- "enum": [
- "open",
- "closed"
- ],
- "context": [
- "view",
- "edit"
- ]
- },
- "meta": {
- "description": "Meta fields.",
- "type": "object",
- "context": [
- "view",
- "edit"
- ],
- "properties": {
- "book_language": {
- "type": "string",
- "description": "Books language should be standardized to ISO 639-2",
- "default": null
- },
- "book_series": {
- "type": "string",
- "description": "Series Name",
- "default": null
- },
- "book_series_number": {
- "type": "integer",
- "description": "Series Number Integer",
- "default": null
- },
- "book_file_id": {
- "type": "string",
- "description": "File Server ID",
- "default": null
- },
- "book_publish_date": {
- "type": "string",
- "description": "Published Date",
- "default": null
- }
- }
- },
- "template": {
- "description": "The theme file to use to display the object.",
- "type": "string",
- "context": [
- "view",
- "edit"
- ]
- },
- "authors": {
- "description": "The terms assigned to the object in the book_id taxonomy.",
- "type": "array",
- "items": {
- "type": "integer"
- },
- "context": [
- "view",
- "edit"
- ]
- }
- }
- },
- "_links": {
- "self": "http://wordpress.ebook.dev/index.php/wp-json/wp/v2/books"
- }
- }
Add Comment
Please, Sign In to add comment