Opened 3 years ago
Closed 3 years ago
#8498 closed enhancement (fixed)
Suggestion for unsettling some attributes in BP_Button instead of all other places
Reported by: | sbrajesh | Owned by: | imath |
---|---|---|---|
Milestone: | 9.0.0 | Priority: | low |
Severity: | normal | Version: | 2.7 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
Hi,
At the moment, while adding a button code, we are using various conditions to detect if the button element is 'button' then we set 'data-bp-nonce' in 'button_attr' array otherwise we set the href attribute.
Instead of setting it conditionally at the time we are registering the buttons(It is being repeated at many places), a better solution will be add both of these attribute while registering button and then checking if the button element is 'button' and reset the 'href' in the BP_Button class.
That will save too many conditions for core as well as 3rd party developers. The 'data-bp-nonce' is a harmless attribute for anchor element, so no need to do anything about that.
I am proposing a patch for it, Please let me know if it is feasible to have it in the core.
Thanks for your suggestion and patch. I need to dive deeply in it but it looks very interesting & promising.