/**
 * Get the posts belonging to a topic.
 *
 * @param array $args {
 *     @type int $topic_id ID of the topic for which posts are being fetched.
 *     @type int $page Optional. Page of results to return. Default: 1.
 *     @type int $page Optional. Number of results to return per page.
 *           Default: 15.
 *     @type string $order 'ASC' or 'DESC'. Default: 'ASC'.
 * }
 * @return array List of posts.
 */
function bp_forums_get_topic_posts($args = '')
{
    /** This action is documented in bp-forums/bp-forums-screens */
    do_action('bbpress_init');
    $defaults = array('topic_id' => false, 'page' => 1, 'per_page' => 15, 'order' => 'ASC');
    $args = wp_parse_args($args, $defaults);
    $query = new BB_Query('post', $args, 'get_thread');
    return bp_forums_get_post_extras($query->results);
}
/** Post Functions ************************************************************/
function bp_forums_get_topic_posts($args = '')
{
    do_action('bbpress_init');
    $defaults = array('topic_id' => false, 'page' => 1, 'per_page' => 15, 'order' => 'ASC');
    $args = nxt_parse_args($args, $defaults);
    $query = new BB_Query('post', $args, 'get_thread');
    return bp_forums_get_post_extras($query->results);
}