• Resolved jasonkadlec

    (@jasonkadlec)


    Even with BadgeOS as the only plugin, and default theme… I can’t get Comments to stop showing up after someone has submitted a BadgeOS Form (meaning this shortcode)

    [badgeos_submission achievement_id=”101″]

    Here is what it looks like after submitting the form:

    https://cl.ly/image/1d1i3c1L381p

    So I tried putting the following into Functions.php — but it has no effect… weird no?

    add_action( 'init', 'kill_badge_comments' );
    function kill_badge_comments() {
    	remove_post_type_support( 'badgeos-log-entry', 'comments' );
    	remove_post_type_support( 'submission', 'comments' );
    }

    ^^ with that in the functions.php – the “comments” checkbox disappears from the screen options in the admin if I go to edit the Submission in the admin… but the Comment On Submission form continues to display and if a comment is left, it shows as well.

    Did I miss a setting somewhere? How do I turn off comments on Submissions?

    Anyone else seeing this?

    https://www.ads-software.com/plugins/badgeos/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Alrighty, that was a fun one to trace my way through.

    In short as can be, during the process of using the shortcode, the function of badgeos_get_submissions() which has 3 internal parameters. “post_type” which defaults to “submission”, “show_attachments” which defaults to true, and “show_comments” which defaults to true.

    Those 3 defaults are not overridden based on provided arguments. Later on, we get to the function badgeos_render_submission which is used for the achievemenet provided by the shortcode. It’s in that function that we check for whether “show_comments” and “show_attachments” are set at all. If they are and they are set to anything but “false”, those spots get rendered. Otherwise, they wouldn’t get shown. Due to never changing the default, it ends up rendering.

    Admittedly, I can’t just haphazardly change this fact in the chain of events and push out an update regarding it, but you’re not out of luck yet either.

    Both the comment form and the comments spots have filters on their output, so this should work to remove them. Add them to your functions.php. the “__return_empty_string” is a WordPress helper function that does exactly what it says. This will replace the BadgeOS-rendered markup with an empty string instead for you. I am assuming you want to do this for ALL submissions, as well.

    add_filter( 'badgeos_get_comment_form', '__return_empty_string' );
    add_filter( 'badgeos_get_comments_for_submission', '__return_empty_string' );

    Let me know how this goes, or if you have any other questions for us.

    Thread Starter jasonkadlec

    (@jasonkadlec)

    Yep, that does the trick. Thanks!

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Out of curiosity, did the “as short as can be” explanation make sense?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Submissions loading comments on the confirm page’ is closed to new replies.