Skip to:
Content

bbPress.org

Ticket #3389: 3389.3.patch

File 3389.3.patch, 1.1 KB (added by johnjamesjacoby, 10 months ago)

Like Clorith's, but using bbPress helper functions

  • src/includes/replies/functions.php

     
    805805                return;
    806806        }
    807807
     808        // Make sure at least 1 revision exists. Remove when fixed upstream.
     809        // See: https://core.trac.wordpress.org/ticket/30854
     810        // See: https://bbpress.trac.wordpress.org/ticket/3389
     811        if ( 0 === bbp_get_reply_revision_count( $reply_id, true ) ) {
     812                wp_save_post_revision( $reply_id );
     813        }
     814
    808815        // Check author_id, fallback to current user ID
    809816        if ( empty( $author_id ) ) {
    810817                $author_id = $user_id;
  • src/includes/topics/functions.php

     
    738738                return;
    739739        }
    740740
     741        // Make sure at least 1 revision exists. Remove when fixed upstream.
     742        // See: https://core.trac.wordpress.org/ticket/30854
     743        // See: https://bbpress.trac.wordpress.org/ticket/3389
     744        if ( 0 === bbp_get_topic_revision_count( $topic_id, true ) ) {
     745                wp_save_post_revision( $topic_id );
     746        }
     747
    741748        // Check author_id, fallback to current user ID
    742749        if ( empty( $author_id ) ) {
    743750                $author_id = $user_id;