I'm trying to insert a custom post through a form. It's a brief post, most content are custom meta fields updated with
add_post_meta. So far, post inserting is working fine, except for a detail. This is the post insert query I'm doing:
$venta = wp_insert_post(array( 'post_name' => "venta-$stamp", 'post_title' => "Venta $stamp", 'post_type' => 'venta', 'comment_status' => 'closed', 'ping_status' => 'closed', // 'post_status' => 'published' ));
Left as shown, it inserts posts as Draft without hassle. But if I uncomment
post_status, the post gets inserted, but it doesn't show up in the All Posts Post Table related to that post type.
If I run a
WP_Query for that
post_type, it shows me the published posts and the post count —both in the Query and in the Post Table top tabs— reflects that those posts actually exist in the database, but can't see them in the Post Table. The only way to see a post in the WP Admin is editing the URL manually to get to the post, so I can modify or delete them.
What is actually happening? What can I do to test what is going on? Any docs I should look at, besides the Developer Resources for