gdbbx_report_show_link

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

Report post feature shows report button for all topics and replies by default. Using the filter ‘gdbbx_report_show_link‘ you can control button visibility for individual topics and replies

This filter provides 2 arguments.

Arguments

  • $show: by default it is set to true, return false to hide the link
  • $id: id of the topic or reply

Example

This example will hide the report for topic/reply with ID’s 5 and 10.

add_filter('gdbbx_report_show_link', 'custom__gdbbx_report_show_link', 10, 2);
function custom__gdbbx_report_show_link($show, $id) {
  if ($id == 5 || $id == 10) {
    $show = false
  }
  return $show;
}
0
0
901
Rate this reference

You are not allowed to rate this post.

Leave a Comment