• Resolved aloncarmel2k

    (@aloncarmel2k)


    Hello,
    I got a website that users can post stuff with a custom made page i’ve constructed.

    $post_title = $thetitle;
    $post_status = ‘publish’;
    $comment_status = ‘open’;
    $post_category = $_POST[‘post_category’];
    $postdata = compact(
    ‘post_type’,
    ‘post_author’,
    ‘post_content’,
    ‘post_title’,
    ‘post_status’,
    ‘comment_status’,’post_category’
    );

    global $wp_filter;
    unset($wp_filter[‘wp_insert_post’]);

    $post_id = wp_insert_post($postdata);

    Everything worked fine until i reached post 1756, since then all posts that i try to post get an ID of 0, and you cannot repost after because of ID duplicate error. Can you tell me whats the issue? i’ve tried repairing the table but it seems fine.

Viewing 1 replies (of 1 total)
  • Thread Starter aloncarmel2k

    (@aloncarmel2k)

    Its resolved. There was an issue with the sql. For some reason the database when i migrated to my new server did not transfer the EXTRA for the tables so nothing was auto_incremented. dues causing errors and duplicates.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_insert_post stopped working’ is closed to new replies.