BuddyDev

Search

bp moderation tools > report button

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 38
    damland on #32728

    Hello,

    I’ve already manually added the report button into the post single.php using:
    <a href="#" data-item-id="<?php echo $postid; ?>" data-item-type="post" data-context="post" data-context-id="<?php echo $postid; ?>" class="bpmts-report-button">Report</a>

    but I now have two report buttons, how can I hide the report button on the post that is generated by the plugin (without using css)?

    Also how to manually add the report button for Custom Post Type posts?
    Thanks

    • This topic was modified 4 years, 2 months ago by damland.
  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #32738

    Hi,
    Thank you for the question.

    1. You can either use a shortcode like

    
    [bpmts_report_button]
    

    or code like

    
    echo  bpmts_get_report_button( array(
    	'label'         => 'Report button label',
    	'item_id'       => get_the_ID(), // post id.
    	'item_type'     => get_post_type(), // post type.
    	'context'       => 'anything',
    	'context_id'    => get_the_ID(),// anything
    	'link_class'    => 'some-css-class',
    	'wrapper_class' => 'some-warpper-css-class',
    ));
    
    

    To enable it for custom post type, Please make sure it is checked under Reportable type in the settings.

    Currently, I was unable to find a good way for disabling button(other than disabling reportable type).

    Please allow me 2 days to put an update for that.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved