Safe Report Comments
[resolved] Link shown twice - no_autostart_safe_report_comments not being defined (2 posts)

  1. flemmo
    Posted 2 years ago #


    I'm trying to do a custom insert using the comments callback but the link is being shown twice. It seems the auto embed is still active even though 'no_autostart_safe_report_comments' is defined in functions .php.

    So this line in safe-report-comments.php

    if ( !defined( 'no_autostart_safe_report_comments' ) )
    	$safe_report_comments = new Safe_Report_Comments;

    Is always returning as true i.e. 'no_autostart_safe_report_comments' not defined.

    I have added this to my functions.php in the root of the theme.

    //flag comments plugin included in themes' functions.php - disable plugin.
    define( 'no_autostart_safe_report_comments', true );
    include_once( '../../plugins/safe-report-comments/safe-report-comments.php');
    // make sure not to auto-attach to comment reply link
    $safe_report_comments = new Safe_Report_Comments(false);
    // change link layout to have a pipe prepended
    add_filter( 'safe_report_comments_flagging_link', 'adjust_flagging_link' );
    function adjust_flagging_link( $link ) {
        return ' | ' . $link;
    // adjust the text to "Report abuse" rather than "Report comment"
    add_filter( 'safe_report_comments_flagging_link_text', 'adjust_flagging_text' );
    function adjust_flagging_text( $text ) {
        return 'Report abuse';

    Where am I going wrong?


  2. Daniel Bachhuber
    Hand Built
    Plugin Contributor

    Posted 2 years ago #

    Your theme is being loaded after the plugin is loaded. You'll want to instead create an MU plugin with the constant definition. Apologies if it seems a little backwards.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Safe Report Comments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic