Forums

[resolved] How do i make this a part of my signup.php? (5 posts)

  1. mdevaney
    Member
    Posted 1 year ago #

    This is after everything else in functions.php I cannot get it to be a part of the sign up form. Any ideas?

    add_action('register_form','my_register_form');
    
    function my_register_form(){
    
    ?>
    
    <p>
    
    <label>Title:<br/>
    <input id="my_field_1" type="text" value="<?php echo $_POST['my_field_1']; ?>" name="my_field_1"/>
    </label>
    
    </p>
    
    <p>
    
    <label>Content:<br/>
    <input id="my_field_2" type="text" value="<?php echo $_POST['my_field_2']; ?>" name="my_field_2"/>
    </label>
    
    </p>
    
    <?php
    
    add_action('user_register', 'my_create_page');
    
    function my_create_page($user_id){
    
           $my_post = array();
           $my_post['post_title'] = $_POST['my_field_1'];
           $my_post['post_type'] = 'page';
           $my_post['post_content'] = $_POST['my_field_2'];
           $my_post['post_status'] = 'publish';
           wp_insert_post( $my_post );
    
          }
       }
  2. mdevaney
    Member
    Posted 11 months ago #

    eh, that code is horrible, i figured it out by hacking the core files.

  3. Andrea_r
    team pirate
    Posted 11 months ago #

    gravity forms plugin would probably have done all you wanted.

  4. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 11 months ago #

    And hacking core will make you have a fit when you upgrade.

  5. mdevaney
    Member
    Posted 11 months ago #

    i used gravity forms and hacked the core. worsk great. not worried about updates, yet. (swiftresumes.com/sign-up)

Topic Closed

This topic has been closed to new replies.

About this Topic