Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter the Admin Links Content

  • @babblebey

    Participant

    I would like to add Icons to the Admin Links, But I do not want use the ::before or ::after, I would like to filter and dictate the content it outputs by adding some html element to it such like <i class="fa fa-reply"></i>

    I hope this is possible

Viewing 13 replies - 1 through 13 (of 13 total)
  • @robin-w

    Moderator

    by admin links, do you mean the edit|merge|close things that appear for admins/mods on topics/replies?

    @babblebey

    Participant

    Yes, Its the same one that displays “reply” for Subscribers/Participants

    @robin-w

    Moderator

    great – just wanted to check.

    so is this a class per link, or a single class for all the links?

    @babblebey

    Participant

    I want to be able to edit each of the Link – Let’s say for example I want to Change ‘Reply’ to ‘Respond’ and also add a fontawesome icon with the html i element.

    @robin-w

    Moderator

    ok, so this (untested) one should put the class in for the edit, and change the word edit to ‘hello’

    can you test and let me know that it works, and I’ll look at the others.

    add_filter ('bbp_before_get_reply_edit_link_parse_args' , 'rew_get_reply_edit_link' ) ;
    
    function rew_get_reply_edit_link ($args) {
    	$args['link_before'] = '<i class="fa fa-edit">' ;
    	$args['link_after'] = '</i>' ;
    	$args['edit_text'] = 'hello' ;
    	
    return $args ;
    }

    Put this in your child theme’s function file – or use

    Code Snippets

    @babblebey

    Participant

    Nothing changed, Robin

    @robin-w

    Moderator

    so you still see ‘edit’ as the link word?

    @babblebey

    Participant

    Yes I still see it

    @robin-w

    Moderator

    ok, where did you put the code?

    @babblebey

    Participant

    My Theme’s functions.php file

    @robin-w

    Moderator

    ah… and are you looking at a reply, not a topic?

    @babblebey

    Participant

    I’m looking at both

    @robin-w

    Moderator

    ok, the code works in my test site, so a reply edit admin link show ‘hello’ instead of ‘Edit’.

    If this is not the case, then it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

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