Tagged: todo
Hi Tosin,
Thank you.I am sorry, we haven’t been able to make any progress as I caught covid mid April. I have recovered since then but I am not sure when we can push an update for this.
For the time being, Can you please use the code snippet?
Regards
BrajeshHello Tosin,
Try the following code. It will add button with post title.
/** * Add report button with title * * @param string $title Post Title. * * @return string */ function buddydev_add_report_button( $title ) { if ( ! function_exists( 'bpmts_user_can_report' ) ) { return $title; } $post_type = 'post'; if ( get_post_type() === $post_type && bpmts_user_can_report() ) { $title .= bpmts_get_report_button( array( 'item_id' => get_the_ID(), 'item_type' => $post_type, 'context' => $post_type, 'context_id' => get_the_ID(), ) ); } return $title; } add_filter( 'the_title', 'buddydev_add_report_button' );
Please do let me know if you need any assistance with this code.
Regards
RaviThe code messed up this page https://www.nigerpress.com/archive/ the code should not show or display blog post archive pages for posts and other custom post types. The button should only display in the title of single posts and single adverts.
The button is also displaying in menu
see link for example https://www.nigerpress.com/article/business-palm-oil-saga/The button is also not showing in the custom post type advert see https://www.nigerpress.com/advert/high-quality-traditional-clothing-wares/
Hi Tosin,
Please do not used the above code. Ravi misunderstood the question and provided code for a different purpose. I am working on a release today for moderation tools. Will be providing the code after that.Thank you
BrajeshThank you Tosin.
1. Please upgrade to the latest version.
2. Please add the following code// disable moderation tools reporting button after the post content. add_filter( 'bpmts_is_reporting_button_enabled', function ( $enabled, $location, $args ) { if ( 'after_post_content' === $location ) { $enabled = false; } return $enabled; }, 10, 3 );
That will disable the automatic button in the post content.
Regards
BrajeshHi Tosin,
Thank you.Please use the shortcode form this reply.
https://buddydev.com/support/forums/topic/buddypress-moderation-button-shortcode/#post-36569
Regards
Brajesh
The topic ‘ [Resolved] Buddypress moderation button shortcode’ is closed to new replies.