stripslashes($_POST['post_content']), 'topic_id' => $topic_id, ); foreach( array('post_author', 'post_email', 'post_url') as $field ) { if ( ! empty( $$field ) ) { $post_data[$field] = $$field; } } $post_id = bb_insert_post($post_data); $tags = trim( $_POST['tags'] ); bb_add_topic_tags( $topic_id, $tags ); $topic = get_topic( $topic_id, false ); $link = get_post_link($post_id); if ( $topic->topic_posts ) $link = add_query_arg( 'replies', $topic->topic_posts, $link ); // This action used to be bb_post.php, changed to avoid conflict in bb_load_template() do_action( 'bb-post.php', $post_id ); if ($post_id) wp_redirect( $link ); else wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) ); exit;