[buddypress-trac] [BuddyPress Trac] #7532: BP_Button needs to update `$parent_element` and `$parent_attr`

buddypress-trac noreply at wordpress.org
Tue May 30 20:54:57 UTC 2017

#7532: BP_Button needs to update `$parent_element` and `$parent_attr`
 Reporter:  r-a-y         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  2.9
Component:  Core          |    Version:  2.8.0
 Severity:  normal        |   Keywords:  has-patch
 If you are filtering `'bp_get_button'` and want to make adjustments to the
 button based on what the $parent_element or $parent_attr is, you can't
 since those properties are not updated in the `BP_Button` class.

 For example:

 add_filter( 'bp_get_button', function( $retval, $args, $button ) {
         // Check to see if we're using an older button.
         // This will fail at the moment.
         // You could use $button->wrapper, but then you would need to re-
         // the button element with $button->parent_attr, which would also
         // to be updated.
         if ( 'div' === $button->parent_element) {
                 // Do something here like re-render the button.
         return $retval;
 }, 10, 3 );

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7532>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list