0

Theres something strange in the neighborhood.. Seriously.. I think my wordpress is haunted. I've been working on a plugin that creates a post from a form and its been working fine for several weeks, submit the form, the post is published.

Now, bear in mind that Ive made no changes to the function that creates the post, everytime I submit the form the post is automatically scheduled.

Whats going on and what can I do to get it working normal again? Its super annoying.

Thanks!

-- UPDATE --

As requested te code that creates the post:

INSERT POST

        $new_post = array(
                'comment_status' => 'open',
                'ping_status' => 'open',
                'post_title' => $productName,
                'post_content' => $productDesc,
                'post_status' => 'publish',
                'post_date' => date('Y-m-d H:i:s'),
                'post_author' => $currentUser,
                'post_type' => 'products',
                'post_category' => array(0)
                );

        $post_id = wp_insert_post($new_post);
  • 2
    Please elaborate on what exactly is happening and code implementing it. Something had changed for behavior to change. – Rarst Dec 5 '13 at 23:59
  • Ok, I've updated it with the code I use to create the post. – Jon Furry Dec 10 '13 at 3:11
  • 1
    Are you sure that date() there produces what you expect it to? PHP's date functions are highly unreliable in WP environment since it resets time zone and stuff. – Rarst Dec 10 '13 at 10:34
  • @rarst you know what, that very well could be the issue. I will look into that. Thanks for the tip. – Jon Furry Dec 13 '13 at 19:04
  • @JonFurry did you find that this was indeed the issue? – bosco Jan 1 '14 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.