Is there a function in the wordpress api that lets me programatically add pages ?
something on the lines of :
add_page($title,$content)
Is there such a function ?
Is there a function in the wordpress api that lets me programatically add pages ?
something on the lines of :
add_page($title,$content)
Is there such a function ?
You must be logged in to post a comment.
Yes, it’s
wp_insert_post()
.Also since WordPress integrated a HTTP API there are other new ways to handle creating content in WP via API
https://developer.wordpress.org/rest-api/reference/pages/#create-a-page
https://developer.wordpress.org/rest-api/reference/posts/#create-a-post
All very cool stuff!