BP Registration Options 3.0.3 with Fixes for BuddyPress 1.3 – Trunk

Just posting some modifications made to get the BP Registration Options 3.0.3 plugin working with WordPress 3.2-trunk and BuddyPress 1.3-trunk that I needed for a current project. This was only tested on a WordPress multi-site network with BuddyPress and using sub-domain mapping, so my modifications may not fix everything for you. I also did not build in any backwards compatibility or test with BuddyPress 1.2.8. Here are my notes.

  1. I got the menus added to the WordPress multi-site “Network” menu.
  2. Removed the global $iprefix and went with $wpdb->base_prefix to set the database prefixes instead. Not really necessary, but cleaner and possibly more appropriate.
  3. Created the pbrwg_get_loaded_components() function to replace $bp->root_components since I think it’s depreciated. The pbrwg_get_loaded_components() uses the $bp->pages objects to build an array with the component name as the key and the slug as the value. This should replace some URL parsing since $bp->current_component can be used instead of trying to figure out the URL to component relationship.
  4. Changed the ‘bp_core_activate_account’ action for ‘bp_members_activated_user’ and passed through the user-ID.
  5. Changed a few values from string to INT where possibly appropriate.

Stopped myself, but probably could have done some isset() and empty() in a few places. I didn’t want to rewrite the whole plugin because I’m expecting this will improve as BuddyPress gets updated, and I don’t want to merge a massive change back into the current project using this plugin. BP Registration Options has a nice simple premise, but just needs a little code simplification love (not that my_overly_verbose_ass can do any better).

All the changes are in this package: BP Registration Options 3.0.3 with Fixes for BuddyPress 1.3 (zip)