How can I automatically create a WordPress page (for example, when plugin is activated)?
Leave a Reply
You must be logged in to post a comment.
How can I automatically create a WordPress page (for example, when plugin is activated)?
You must be logged in to post a comment.
Use
wp_insert_post()
, which can insert pages as well: http://codex.wordpress.org/Function_Reference/wp_insert_postSee post_type below.
WordPress provides the wp->query API method for database abstraction. You can create the appropriate query to make a Page when needed.