Skip to:
Content

bbPress.org

Ticket #2817: 2817.2.diff

File 2817.2.diff, 1.7 KB (added by tharsheblows, 11 years ago)

change which wp_insert_post returns WP Error object in replies/functions.php

  • src/includes/forums/functions.php

    diff --git a/src/includes/forums/functions.php b/src/includes/forums/functions.php
    index 56ec78c..f32cfa0 100644
    a b function bbp_new_forum_handler( $action = '' ) { 
    261261                'comment_status' => 'closed'
    262262        ) );
    263263
    264         // Insert forum
    265         $forum_id = wp_insert_post( $forum_data );
     264        // Insert forum. Return WP Error object on failure.
     265        $forum_id = wp_insert_post( $forum_data, true );
    266266
    267267        /** No Errors *************************************************************/
    268268
  • src/includes/replies/functions.php

    diff --git a/src/includes/replies/functions.php b/src/includes/replies/functions.php
    index 4cc223c..71da3ef 100644
    a b function bbp_new_reply_handler( $action = '' ) { 
    361361                'menu_order'     => bbp_get_topic_reply_count( $topic_id, true ) + 1
    362362        ) );
    363363
    364         // Insert reply
    365         $reply_id = wp_insert_post( $reply_data );
     364        // Insert reply. Return WP Error object on failure.
     365        $reply_id = wp_insert_post( $reply_data, true );
    366366
    367367        /** No Errors *************************************************************/
    368368
  • src/includes/topics/functions.php

    diff --git a/src/includes/topics/functions.php b/src/includes/topics/functions.php
    index 21bfd18..f422488 100644
    a b function bbp_new_topic_handler( $action = '' ) { 
    336336                'comment_status' => 'closed'
    337337        ) );
    338338
    339         // Insert topic
    340         $topic_id = wp_insert_post( $topic_data );
     339        // Insert topic. Return WP Error object on failure.
     340        $topic_id = wp_insert_post( $topic_data, true );
    341341
    342342        /** No Errors *************************************************************/
    343343