I have a front end form that let users submit a post.
This is how i store the data when a post is submitted :
if ( isset( $_POST['submitted'] )) {
$post_information = array(
'post_title' => wp_strip_all_tags( $_POST['postTitle'] ),
'post_content' => $_POST['postContent'],
'post_type' => 'post',
'post_status' => 'publish'
);
$new_post = wp_insert_post( $post_information );
The post is not showing in my post page unless i go through my dashboard and click over The UPDATE button.
THIS IS HOW I QUERY MY POSTS :
$args = array(
'posts_per_page' => 5,
'paged' => $paged,
'meta_query' => array(
array( 'key' => '_wti_like_count','value' => 5, 'compare' => '<=','type' => 'numeric')
)
);
query_posts( $args );
How can i make my submitted posts publish automatically?