BuddyDev

Search

BuddyPress Moderation Tools Customization API

  • Participant
    Youshall Thrive on #22614

    I recently purchased the BuddyPress Moderation Tools plugin and I need to include a report post button on individual posts (of a custom post type). I can’t find any documentation for this even though I see it mentioned in the features of the plugin that there is an API to handle integrating the features of this plugin into custom post types and custom UI, but I can’t find any examples of this or instructions.

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #22616

    Hi Youshall Thrive,
    Thank you for using Moderation Tools.

    If you are using our latest version, you can enable the integration from Moderation tools settings page.

    It will automatically add the report button. You can also use following code to add the button manually

    
    		if ( bpmts_user_can_report() ) {
    			echo bpmts_get_report_button( array(
    				'item_id'    => get_the_ID(),
    				'item_type'  => $post_type,
    				'context'    => $post_type,
    				'context_id' => get_the_ID(),
    			) );
    		}
    
    

    The important part are item_id and item_type. Please make sure that you have enable the post type as report able in the settings.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved