Inserting and deleting a Post and Parts of a Post - Post, Meta, Taxonomy

Shortcode: aw2_insert_post

See http://codex.wordpress.org/Function_Reference/wp_insert_post

Parameters

——————-
store_new_post_id: Store the post Id which is returned in this variable

Example

—————-

[aw2_code]
[aw2_insert_post store_new_post_id=’news_id’]
{
“post_title”:”hello dolly”,
“post_content”:”this is the post”,
“post_type”:”post”,
“post_status”:”publish”
}
[/aw2_insert_post]

Will return the id of the new post created in news_id[/aw2_code]

Shortcode: aw2_set_meta

Parameters

——————-


post_id: The post_id to update meta of
Loops through json object and creates meta of all values

Example

—————–

Shortcode: aw2_set_taxonomy

Parameters

——————-


post_id: The post_id to update taxonomy of


taxonomy: the taxonomy to update for


terms: the terms to update. Must be IDs


terms_slugs: the term slugs to update. Better than using IDs


append: if append=true will append terms rather than overwrite


See http://codex.wordpress.org/Function_Reference/wp_set_post_terms

Example

—————-

Shortcode: aw2_delete_post

Parameters

——————–


post_id: The post_id to update taxonomy of


force: boolean




see: http://codex.wordpress.org/Function_Reference/wp_delete_post for usage