There are a few plugins that I know that after installation they will create pages or posts. How do you do this?
Tried to research but could not find helpful guide.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
wp_insert_postreference on the WordPress Codex might help.Here’s an example code of how to create a new post programmatically:
To run this code automatically when your plugin is activated, you can wrap this code in the
register_activation_hookhook.