Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author scribu

    (@scribu)

    I was looking at creating something similar to P2P_User like P2P_BPGroup but unsure how this this would be connect in the register connection function.

    The P2P_User class is just a decorator for making WP_User objects look more similar to WP_Post objects. The real logic for handling connections is in the P2P_Side_User class.

    If you follow the code flow starting from p2p_register_connection_type(), you’ll eventually reach P2P_Connection_Type_Factory::create_side(), which has this line:

    $class = 'P2P_Side_' . ucfirst( $object_type );

    So, if you want to register a connection type with 'from' => 'bpgroup' or 'to' => 'bpgroup' (or both), you’re going to need a class that’s called P2P_Side_Bpgroup.

    Any help would be excellent, once complete I will issue a pull request so it can be integrated in a future release.

    I think it would be better if you opened a PR just as soon as you make any sort of progress. That way, I can see what you’ve done so far and answer questions inline.

    Thread Starter clariner

    (@clariner)

    Hi Scribu,

    Thanks for the points, I have sent a pull request which cover all the additional files I have created.

    I haven’t really started on the logic of P2P_Side_Bpgroup but looks like I need to covert the passed arguments so they work with buddypress’s get group function.

    I’ll await your pull request comments.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding Support For Buddypress Groups’ is closed to new replies.