Skip to:
Content

bbPress.org

Ticket #2732: 2732.diff

File 2732.diff, 1.1 KB (added by tharsheblows, 9 years ago)

set initial menu_order of non-published replies to 0

  • src/includes/replies/functions.php

     
    302302
    303303        /** Reply Status **********************************************************/
    304304
    305         // Maybe put into moderation
     305        // Maybe put into moderation and set the menu_order to zero
    306306        if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
    307307                $reply_status = bbp_get_pending_status_id();
     308                $menu_order = 0;
    308309
    309310        // Default
    310311        } else {
    311312                $reply_status = bbp_get_public_status_id();
     313                $menu_order = bbp_get_topic_reply_count( $topic_id, true ) + 1;
    312314        }
    313315
    314316        /** Reply To **************************************************************/
     
    361363                'post_parent'    => $topic_id,
    362364                'post_type'      => bbp_get_reply_post_type(),
    363365                'comment_status' => 'closed',
    364                 'menu_order'     => bbp_get_topic_reply_count( $topic_id, true ) + 1
     366                'menu_order'     => $menu_order
    365367        ) );
    366368
    367369        // Insert reply