Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create Group from User Registration


  • slastik
    Participant

    @slastik

    Hi!

    We are running the latest Buddypress and WordPress installations.

    We are an institute with many classes, we want instructors to be able to set up their own group, and self-assign, when registering from a Profile Field (called Class). In that group they will have their own courses.

    Our aim is to allow instructor users to create new groups when signing up to the registration form instead of us manually creating them.

    Very simple we want to take the Profile Field (Class) from the instructor Registration Form and insert that as a new Group into Buddypress when the user selects submit, how do we do this please?

    Logic:
    1.When the instructor user clicks on submit on the Registration Form
    2. Take the text value of Profile Field (Class)
    3.Create a Group in WP Admin using the text value and assign the user into the Class.
    4. Do not make user admin.

Viewing 1 replies (of 1 total)

  • slastik
    Participant

    @slastik

    My attempt at fixing it:

    `// define the bp_after_registration_submit_buttons callback
    function action_bp_after_registration_submit_buttons($field_id, $value) {
    // make action magic happen here…

    wp_insert_post(
    array ( ‘post_type’ => ‘bp_groups’,
    ‘post_title’ => $_POST[‘field_12’][‘value’],
    ‘post_content’ => ‘This is a description’,
    ‘post_status’ => ‘publish’,
    )
    );

    };

    // add the action
    add_action( ‘bp_after_registration_submit_buttons’, ‘action_bp_after_registration_submit_buttons’, 10, 0 );

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar