Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter lehket

    (@lehket)

    Quick update: I can get post_parent set by first using wp_insert_post() to create the page and then wp_update_post() as follows:


    $my_post = array();
    $my_post['ID'] = $post_ID;
    $my_post['post_parent'] = $parentID;
    wp_update_post($my_post);

    But this is a workaround for what looks to me like a bug in wp_insert_post(). So I’m leaving this unresolved at the moment to see if anyone can either (a) point out what I’m doing wrong or (b) confirm that wp_insert_post() really isn’t setting post_parent as it should or (c) possibly even indicate that wp_insert_post() was never meant to set the post_parent (although that seems unlikely).

    Thanks again.

    Thread Starter lehket

    (@lehket)

    Oh yeah . . . thanks! I actually caught that, too, sometime after I had posted the message. The main problem remains, however. post_parent is not set in the database after the call to wp_insert_post, even though it is set in the $wm_mypost object.

    Forum: Plugins
    In reply to: Fetch Post By Title
    Thread Starter lehket

    (@lehket)

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)