Skip to:
Content
Pages
Categories
Search
Top
Bottom

Can't change text of ajax addremove friend buttons?


  • godavid33
    Participant

    @godavid33

    I’m going crazy here, I’m trying to change the text of the add friend/cancel friendship request button, but I can’t change it for the life of me. It seems I have no clue where it’s coming from. I managed to successfully do this with the favorite button by remove_action-ing the ajax handler that is registered in ajax.php. I then added my own custom action (essentially just a clone, with different text). Why not just use a .mo file you ask? I AM! For some reason or other, Ajax functions just seem to ignore it.

    But here’s the kicker, in ajax.php I removed the line

    
    		'addremove_friend'  => 'bp_dtheme_ajax_addremove_friend',
    

    just for a gas. AND THE BUTTON TEXT IS STILL CHANGING? So either I’m crAZy, an idiot, or looking at the wrong function. In which case, I don’t understand what function would be doing this kind of thing if it’s not in ajax.php….

Viewing 2 replies - 1 through 2 (of 2 total)
  • The label of the button is internationalized. See bp-friends-template.php : bp_get_add_friend_button()

    I’d double-check this guide: https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/

    I personally had trouble with getting the naming convention on the .po and .mo files right.


    godavid33
    Participant

    @godavid33

    The .mo and .po files are right, it’s just about the ajax. At any rate, I found my problem – if you have the Buddypress Extended Friend Request Plugin activated, the method I outlined above won’t work because they are already unhooking the bp core function to use their own!

    If you don’t use the BP extended friend request plugin, and want to know how I changed the text of the ajax button just holla and I’ll throw my code up.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can't change text of ajax addremove friend buttons?’ is closed to new replies.
Skip to toolbar