Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter the Admin Links Content


  • Babblebey
    Participant

    @babblebey

    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

    @robin-w

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


    Babblebey
    Participant

    @babblebey

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


    Robin W
    Moderator

    @robin-w

    great – just wanted to check.

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


    Babblebey
    Participant

    @babblebey

    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

    @robin-w

    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

    @babblebey

    Nothing changed, Robin


    Robin W
    Moderator

    @robin-w

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


    Babblebey
    Participant

    @babblebey

    Yes I still see it


    Robin W
    Moderator

    @robin-w

    ok, where did you put the code?


    Babblebey
    Participant

    @babblebey

    My Theme’s functions.php file


    Robin W
    Moderator

    @robin-w

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


    Babblebey
    Participant

    @babblebey

    I’m looking at both


    Robin W
    Moderator

    @robin-w

    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