BuddyDev

Search

[Resolved] BuddyPress Moderation Tools – Report for Activity Comments

  • Participant
    Level: Enlightened
    Posts: 56
    John B on #32638

    I’m using the following code on my Activity Stream to display the Report button next to posts. It works great.

    
    <?php echo bpmts_get_report_button( array(
    			    'item_id'     => bp_get_activity_id(),
    				'item_type'   => 'bp_activity',
    				'context'     => bp_get_activity_object_name(),
    				'context_id'  => bp_get_activity_item_id(),
                    'link_class'  => 'report-pop',
    		) ); 
              ?>
    

    I’m also using the same code to display the Report button next to Activity Comments. I just discovered that it isn’t working as expected. Instead of the comment being reported, the original post gets reported when hitting the Report button.

    What is the correct code to use for Activity Comments?

    Thx

  • Keymaster
    (BuddyDev Team)
    Posts: 20151
    Brajesh Singh on #32639

    Hi John,
    Thank you for the reply.

    The problem lies with the item type.

    Here is the code you may use

    
    <?php 
    echo bpmts_report_button( array(
    				'item_id'     => bp_get_activity_comment_id(),
    				'item_type'   => 'bp_acomment',
    				'context'     => 'activity_reply',
    				'context_id'  => bp_get_activity_comment_id(),
    				'link_class'  => 'report-pop',
    			) );
    
    ?>
    
    

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 56
    John B on #32641

    I just used the following code and it appears to have fixed it.

    
    'item_id'     => bp_get_activity_comment_id(),
    				'item_type'   => 'bp_acomment',
    				'context'     => 'activity_reply',
    				'context_id'  => bp_get_activity_comment_id(),
    				'use_wrapper' => false,
    				'link_class'  => 'bp-secondary-action',
    

    Thank you!!!!!!!!!

  • Keymaster
    (BuddyDev Team)
    Posts: 20151
    Brajesh Singh on #32642

    Hi John,
    Yes, that code is correct.

    I just changed your class as you were using ‘report-pop’ earlier.

    Regards
    Brajesh

The topic ‘ [Resolved] BuddyPress Moderation Tools – Report for Activity Comments’ is closed to new replies.

This topic is: resolved