• I was using this function previously as a part of a dropdown with the name ‘group’ on the Users > Add New screen to be able to add a user to a group upon creation.

    function save_form_fields( $user_id ) {
        CTXPS_Queries::add_membership($user_id, trim( $_POST['group'] ));
    }
    add_action( 'user_register', 'save_form_fields' );

    Now, I don’t know if a WordPress update has borked this, but it no longer puts the user in the group upon user creation. Is there another/better way I can go about doing this?

    https://wordpress.org/plugins/contexture-page-security/

The topic ‘Adding membership programatically – no longer working?’ is closed to new replies.