Imas funkciju wp_insert_post za to
http://codex.wordpress.org/Function_...wp_insert_post
Samo je stavi u loop. Ja ovo koristim za slanje postova sa frontend:
Kôd:
// Add the content of the form to $post as an array
$post = array (
'post_title' => $title,
'post_content' => $content,
'post_category' => $cat, // Usable for custom taxonomies too
'tags_input' => $tags,
'post_status' => 'draft', // Choose: publish, preview, future, etc.
'post_type' => 'post' // Use a custom post type if you want to
);
$post_id = wp_insert_post($post); // Pass the value of $post to WordPress the insert function
Ali proveri pre nego sto upises u bazu:
Kôd:
print '<pre>';
print_r ($post);
print "</pre>";