Hello,
Thanks for this nice plugin but even following clearly your indication it’s not working with following call:
[guest-posts category=’14985′ author=’5′]
Would be happy to find the trick, thanks for your help!
This is a part of Guest Posts Plugin for WordPress.
*/
//Get the submitted form
ob_start();
require_once($_POST["rootpath"]);
$title = $_POST["title"];
$longtitle = $_POST["longtitle"];
$story = $_POST["story"];
$resume = $_POST["resume"];
$image_100100 = $_POST["image_100-100"];
$image_490270 = $_POST["image_490-270"];
$tags = $_POST["tags"];
$authorbio = $_POST["authorbio"];
$auteurimage = $_POST["auteurimage"];
$youtubelink = $_POST["youtubelink"];
$email = $_POST["email"];
$deezeralbum = $_POST["deezeralbum"];
$authorid = $_POST["authorid"];
$artiste_nc = $_POST["artiste_nc"];
$category = $_POST["category"];
$thankyou = $_POST["thanks"];
$path = $_POST["rootpath"];
$nonce=$_POST["_wpnonce"];
//Load WordPress
//require($path);
//Verify the form fields
if (! wp_verify_nonce($nonce) ) die('Security check');
//Post Properties
$new_post = array(
'post_title' => $title,
'post_content' => $story,
'post_category' => $category, // Usable for custom taxonomies too
'tags_input' => $tags,
'post_status' => 'pending', // Choose: publish, preview, future, draft, etc.
'post_type' => 'post', //'post',page' or use a custom post type if you want to
'post_author' => $author, //Author ID
);
//save the new post
$pid = wp_insert_post($new_post);
/* Insert Form data into Custom Fields */
add_post_meta($pid, 'auteur_n1', $auteur_n1, true);
add_post_meta($pid, 'author-email', $email, true);
add_post_meta($pid, 'author-website', $site, true);
add_post_meta($pid, 'artiste_nc', $artiste_nc, true);
add_post_meta($pid, 'resume', $resume, true);
add_post_meta($pid, 'longtitle', $longtitle, true);
add_post_meta($pid, 'image_100-100', $image_100100, true);
add_post_meta($pid, 'image_490-270', $image_490270, true);
add_post_meta($pid, 'youtubelink', $youtubelink, true);
add_post_meta($pid, 'authorbio', $authorbio, true);
add_post_meta($pid, 'auteurimage', $auteurimage, true);
add_post_meta($pid, 'deezeralbum', $deezeralbum, true);
header("Location: $thankyou");
?>