Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add bbp_author_ip to backend


  • jemar707
    Participant

    @jemar707

    We have fairly active trolls on top of our very active community. Our forum allows anonymous users and we need to be able to quickly identify bad actors from the backend when they are switching names and posting many replies and topics.

    I’d like to be able to quickly see the IP address for the author of topics and replies from the replies and topics admin pages. Doing so from the front end is not efficient because we can’t make bulk changes.

    I have been digging around bbp-replies.php and not sure how to extend it to include another column, if that is even the right starting point. Any thoughts on how to achieve this?

Viewing 3 replies - 1 through 3 (of 3 total)

  • Robin W
    Moderator

    @robin-w

    basically bbpress has the ability to add columns via a filter

    This should do it

    add_filter("bbp_admin_replies_column_headers", 'rew_IP_column_add');
    add_filter("manage_reply_posts_custom_column", 'rew_IP_column_value', 10, 3);
    
    function rew_IP_column_add($columns)  {
    	$new = array();
      foreach($columns as $key => $title) {
        if ($key=='bbp_reply_forum') // Put the forum ID column before the Replies forum column
          $new['rew_id'] = 'IP Address';
        $new[$key] = $title;
      }
      return $new;
    }
    	
    function rew_IP_column_value($column_name, $id) {
    		if ($column_name == 'rew_id') echo get_post_meta( $id, '_bbp_author_ip', true );
    }

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

    Code Snippets


    jemar707
    Participant

    @jemar707

    Thank you! I sent some love through PP on your website for all your work! Hoping I can take this and make it work for topics too.

    I tagged you in an old separate topic if you have any solutions for my replies problem on the front end:

    Redirection when newest replies are at the top.


    Robin W
    Moderator

    @robin-w

    thanks – glad it worked for you, and very much thanks for the PP !!

    I’ll look at the other thread later – on way out today !!

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