buddypress / next-template-packs

is this the next BuddyPress template pack?
35 stars 9 forks source link

Update/re-factor BP_Buttons_Group() #79

Closed hnla closed 7 years ago

hnla commented 8 years ago

In Nouveau we have an updated series of classes and functions handling the action button creation for loop lists.

While we use BP core bp_get_buttton() for the looped individual items we have our own classes and a function that provides for a generic group wrapper to any set of elements.

Currently BP core is restrictive and only allows anchors to be set this is being patched on: https://buddypress.trac.wordpress.org/ticket/7226#comment:6

This patch will allow the items to be set as elements of type: a | button
button elements will have further attr suitable for buttons and the $wrapper will be extended to take type = 'li'

Nouveau classes and functions are updated here to also allow for the same choices by extending the $args available so that our bp_nouveau-wrapper() will accept an ul $arg and the button functions will pass $args around so we can tell bp_get_button() what $wrapper e.g 'li' we require.

BP locals will need patching though for the class-bp-button.php file:

https://buddypress.trac.wordpress.org/raw-attachment/ticket/7226/7226-07.patch

hnla commented 8 years ago

@todo: there is some issue with the args for 'parent_element' and specifically setting the arg array for 'parent_attr' =>array( 'id' => 'parent-id' ) It appears to upset the first series of iterations in the button loop adding parent element where none required.

This might be something obvious overlooked and easily fixed, noted here for another day.

hnla commented 8 years ago

The mirror set of files managing the same button actions for members appears to have issues implementing the same updated functionality, and despite spending time trying to get this working can't see the issue. ( button args are not being accepted and rendered i.e 'button' passed through will not force the element to be a button as it should.

In actuality issue is that all attrs need to be expressed as new arrays so parse_args need changing.

This developer probably run out of time and energy for this overall functionality, lions share of work done needs review and tidy by another.

hnla commented 8 years ago

In the ongoing working through of the various member buttons to use the new args in 'bp_nouveau_get_members_buttons()`

I have run up against the bp_get_add_friend_button() noted here in the function.

`/**

A comment on the core trac ticket is made asking for review and commit.