hmTodd (@hmtodd)

Forum Replies Created

Viewing 1 replies (of 1 total)
  • @hmtodd

    Member

    Hate to answer my own question, but in case anyone wants to try this here is some sample code to start with –

    <html>
    <body>
    This is it.
    <?php
    // include WordPress
    define('WP_USE_THEMES', false);
    require('./blog/wp-load.php');

    // Handle INSERT if data is Posted
    if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == "bbp-new-topic") {
    $new_topic = array(
    'post_parent' => $_POST['bbp_forum_id'], // forum ID
    'post_content' => $_POST['bbp_topic_content'],
    'post_title' => $_POST['bbp_topic_title']
    );
    $topic_meta = array(
    'forum_id' => $new_topic['post_parent']
    );

    $topic_id = bbp_insert_topic($new_topic, $topic_meta);
    echo('<br>Topic ID = '.$topic_id . '<br>');
    } // end INSERT

    // Use Shortcode to show New Topic Form.
    // Could also create your own form.
    echo do_shortcode('[bbp-topic-form]');
    ?>
    Thats it.
    </body></html>

Viewing 1 replies (of 1 total)