Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/21/2015 09:57:32 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Inserts: When inserting a forum/topic/reply, immediately update the new object so hierarchy is refreshed.

This commit addresses the last active post ID being incorrect after inserting topics and replies to a forum, and fixes a failing test (in BBP_Tests_Core_Update::test_bbp_create_initial_content).

See #2805.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/functions.php

    r5770 r5775  
    4343
    4444    // Insert forum
    45     $forum_id   = wp_insert_post( $forum_data );
     45    $forum_id = wp_insert_post( $forum_data );
    4646
    4747    // Bail if no forum was added
     
    6868        update_post_meta( $forum_id, '_bbp_' . $meta_key, $meta_value );
    6969    }
     70
     71    // Update the forum and hierarchy
     72    bbp_update_forum( array(
     73        'forum_id' => $forum_id,
     74    ) );
    7075
    7176    // Return new forum ID
Note: See TracChangeset for help on using the changeset viewer.