这是我尝试使用邮递员发布的其余api路由这是我如何为真实州 property 的新属性发布数据
http:// localhost:83 / real-state / wordpress / wp-json / wp / v2 / property
{
"title":"Demo title",
"content":"Demo content",
"real_estate_property_price": "3000",
"real_estate_property_size": "600",
"real_estate_property_bedrooms": "3",
"real_estate_property_bathrooms": "1",
"status": "publish"
}
这是我得到的回应
{
"id": 2124,
"date": "2018-05-01T06:18:03",
"date_gmt": "2018-05-01T06:18:03",
"guid": {
"rendered": "http://localhost:83/real-state/wordpress/property/demo-title/",
"raw": "http://localhost:83/real-state/wordpress/property/demo-title/"
},
"modified": "2018-05-01T06:18:03",
"modified_gmt": "2018-05-01T06:18:03",
"password": "",
"slug": "demo-title",
"status": "publish",
"type": "property",
"link": "http://localhost:83/real-state/wordpress/property/demo-title/",
"title": {
"raw": "Demo title",
"rendered": "Demo title"
},
"content": {
"raw": "Demo content",
"rendered": "<p>Demo content</p>\n",
"protected": false
},
"author": 1,
"featured_media": 0,
"menu_order": 0,
"comment_status": "open",
"ping_status": "closed",
"template": "",
"real_estate_property_author": "",
"real_estate_property_agent": "",
"real_estate_property_identity": "",
"real_estate_property_price": "",
"real_estate_package_key": "",
"real_estate_property_price_postfix": "",
"real_estate_property_size": "",
"real_estate_property_land": "",
"real_estate_property_bedrooms": "",
"real_estate_property_bathrooms": "",
"real_estate_property_garage": "",
"real_estate_property_garage_size": "",
"real_estate_property_year": "",
"real_estate_property_video_url": "",
"real_estate_property_image_360": "",
"real_estate_floors_enable": "",
"real_estate_floors": "",
"real_estate_agent_display_option": "",
"real_estate_property_address": "",
"real_estate_property_country": "",
"real_estate_property_zip": "",
"real_estate_property_images": "",
"real_estate_property_location": "",
"real_estate_additional_features": "",
"real_estate_additional_feature_title": "",
"real_estate_additional_feature_value": "",
"real_estate_property_other_contact_name": "",
"real_estate_property_other_contact_mail": "",
"real_estate_property_other_contact_phone": "",
"real_estate_property_other_contact_description": "",
"real_estate_property_video_image": "",
"real_estate_property_sec_price": "",
"real_estate_property_size_postfix": "",
"real_estate_property_land_postfix": "",
"real_estate_property_featured": "",
"slide_template": "",
"real_estate_property_views_count": "",
"real_estate_property_virtual_tour_type": "",
"real_estate_property_virtual_tour": "",
"real_estate_property_price_short": "",
"real_estate_property_price_unit": "",
"real_estate_property_price_prefix": "",
"real_estate_property_price_on_call": "",
"real_estate_property_rooms": "",
"real_estate_property_attachments": "",
"real_estate_private_note": "",
"_links": {
"self": [
{
"href": "http://localhost:83/real-state/wordpress/wp-json/wp/v2/property/2124"
}
],
"collection": [
{
"href": "http://localhost:83/real-state/wordpress/wp-json/wp/v2/property"
}
],
"about": [
{
"href": "http://localhost:83/real-state/wordpress/wp-json/wp/v2/types/property"
}
],
"author": [
{
"embeddable": true,
"href": "http://localhost:83/real-state/wordpress/wp-json/wp/v2/users/1"
}
],
"replies": [
{
"embeddable": true,
"href": "http://localhost:83/real-state/wordpress/wp-json/wp/v2/comments?post=2124"
}
],
"version-history": [
{
"href": "http://localhost:83/real-state/wordpress/wp-json/wp/v2/property/2124/revisions"
}
],
"wp:attachment": [
{
"href": "http://localhost:83/real-state/wordpress/wp-json/wp/v2/media?parent=2124"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}
在这个响应中,我得到了与属性相关的所有密钥,但是在数据库中这些字段没有添加到相关表上,如post元表和其他表,也没有在响应中添加此属性值,传递给创建post "real_estate_property_price": "3000", "real_estate_property_size": "600", "real_estate_property_bedrooms": "3", "real_estate_property_bathrooms": "1",
请帮我看看如何使用rest api为上面创建帖子