Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Our callback to create the contact form page.
- function gym_contact_create_form() {
- $form = array(
- 'post_title' => wp_strip_all_tags( 'Gym Contact Page' ),
- 'post_name' => 'gym-contact-form',
- 'post_status' => 'publish',
- 'post_author' => 1,
- 'post_type' => 'page',
- );
- // Check if page exists
- $page = get_page_by_path('gym-contact-form');
- if ($page == NULL) {
- // Create a page upon creation.
- wp_insert_post( $form );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement