Couple of suggestions & how-to: post user registration to wall and/or add hook for registration

Hey guys

First thing: the Ultimate Facebook plugin is all kinds of awesome. It does exactly what was need for my project with minimal fuss and a whole host of other stuff besides.

However, as always, my client wanted a bit extra, so I hacked a couple of things into the plugin core, which I thought might be nice to add to a new version of the plugin.

Both of these edits were done to /lib/class_wdfb_model.php, and both in the create_new_wp_user_from_fb() function (around line 250).

Just before this line: do_action('wdfb-user_registered', $user_id, $registration); I added this:

$send = array(
'caption' => 'I just signed up for Blah De Bloop De Woo',
'message' => 'I just signed up for exclusive wahs and freestanding oomps. Can you? If so, when? Please.',
'link' => '',
'name' => 'Signup Thing Make Go Now!',
'description' => 'Exclusive things and extra bits.',

$this->post_on_facebook(null, null, $send);

fbRegProcess($user_id, $me);

As you can see I’m using the built-in post_on_facebook() function to post to the user’s wall, and I’m also making a call to a fbRegProcess() function defined in my functions.php file. This accepts the registered WordPress user’s ID and the $me object from Facebook, so I can then process the user’s data however I want. For the moment, just because I wanted to see exactly what was coming through, it just posts the serialized object to the user’s meta_data:

function comufyProcess($user_id, $fbObject) {
update_user_meta($user_id, 'registrationdata', serialize($fbObject));

Initially I tried using the add_action('wdfb-user_registered', 'fbRegProcess', 10, 2); call, but I think I misunderstood what this does; I thought it would send the Facebook registration object (i.e. $me), but it looks like it only sends the custom registration data you’ve defined via the wdfb-registration_fields_array filter.

Just an idea or two, but I thought it might be something someone else might need in the future.