Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding Custom Attributes to Action Buttons Loaded via Ajax


  • stoi2m1
    Participant

    @stoi2m1

    Possible Bug…

    I am using the following code to add data-attributes to the action buttons so I can display a tooltip on hover. This is working fine, however the buttons are swapped via ajax once the action is complete. The returned buttons are not hooked into the filters used to create the buttons on page load.

    function gzp_bp_attributes_to_action_button( $button ) {			
    	$button['link_title'] = $button['link_text'];
    	$button['data-original-title'] = $button['link_text'];
    	$button['link_class'] .= ' hover-tip';	
    	$button['data-toggle'] = 'tooltip';
    	$button['data-placement'] = 'top';
    	
    	return $button;
    }
    add_filter( 'bp_get_group_join_button', 'gzp_bp_attributes_to_action_button', 1 );

    Can someone tell me how do I do this same thing for the buttons returned by the ajax? Maybe this is a bug that needs to be sorted in the core? Any thoughts?

Viewing 1 replies (of 1 total)

  • stoi2m1
    Participant

    @stoi2m1

    Ok, not a bug

    The function that returns the HTML exists in the bp-legacy theme. In buddypress/bp-templates/bp-legacy/buddypress-functions.php

    So I copied the file into my child theme and modified it to act like I wanted.

    Problem Solved!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar