Advertisement
blackimpala

Crear pagina de formulario

Apr 17th, 2020
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. // Our callback to create the contact form page.
  2. function gym_contact_create_form() {
  3.   $form = array(
  4.     'post_title'    => wp_strip_all_tags( 'Gym Contact Page' ),
  5.     'post_name'    => 'gym-contact-form',
  6.     'post_status'   => 'publish',
  7.     'post_author'   => 1,
  8.     'post_type'     => 'page',
  9.   );
  10.   // Check if page exists
  11.   $page = get_page_by_path('gym-contact-form');
  12.   if ($page == NULL) {
  13.     // Create a page upon creation.
  14.     wp_insert_post( $form );
  15.   }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement