query.insert_post
/
Database /
query.insert_post
By Amit Singh. Posted on
Title |
: |
query.insert_post |
Purpose |
: |
Insert or update a post. if args has ‘ID’ set to a value, then post will be updated. args can be array or json |
Syntax |
: |
|
[query.insert_post set='new_post'] { "post_type":"post", "post_title":"new post", "post_status":"publish" } [/query.insert_post] |
|
Input Parameters |
: |
args |
Return Value |
: |
The post ID on success. The value 0 or WP_Error on failure. |
Example 1 |
: |
Code |
: |
|
[arr.create set="template.args"] [post_type]psuedo_poetries[/post_type] [post_title][request.get add-poetry-title /][/post_title] [post_content] [request.get add-poetry-description /] [/post_content] [post_status]publish[/post_status] [/arr.create] [query.insert_post p1={template.args} set="template.post" /] |
|
|
Last Modified By Pravin Kamble.