Ticket #2732: 2732.2.diff
File 2732.2.diff, 1.5 KB (added by , 9 years ago) |
---|
-
src/includes/replies/functions.php
302 302 303 303 /** Reply Status **********************************************************/ 304 304 305 // Maybe put into moderation 305 // Maybe put into moderation and set the menu_order to zero 306 306 if ( !bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 307 307 $reply_status = bbp_get_pending_status_id(); 308 $menu_order = 0; 308 309 309 310 // Default 310 311 } else { 311 312 $reply_status = bbp_get_public_status_id(); 313 $menu_order = bbp_get_topic_reply_count( $topic_id, true ) + 1; 312 314 } 313 315 314 316 /** Reply To **************************************************************/ … … 361 363 'post_parent' => $topic_id, 362 364 'post_type' => bbp_get_reply_post_type(), 363 365 'comment_status' => 'closed', 364 'menu_order' => bbp_get_topic_reply_count( $topic_id, true ) + 1366 'menu_order' => $menu_order 365 367 ) ); 366 368 367 369 // Insert reply … … 1860 1862 // Set publish status 1861 1863 $reply->post_status = bbp_get_public_status_id(); 1862 1864 1865 // Set the menu_order but only if going from original pending to publish, ie only if it has a menu_order == 0 1866 if( $reply->menu_order == 0 ){ 1867 $topic_id = bbp_get_reply_topic_id( $reply->ID ); 1868 $reply->menu_order = bbp_get_topic_reply_count( $topic_id, true ) + 1; 1869 } 1870 1863 1871 // No revisions 1864 1872 remove_action( 'pre_post_update', 'wp_save_post_revision' ); 1865 1873