Hello,

I would like to allow the author of a post to edit it after he/she posts. I currently have this:

<?php get_currentuserinfo();

global $user_ID;
$author_id=$post->post_author;
?>

<?php if ($user_ID == $author_id)

{
    include 'post-upd.php';
}
else
{
    echo "You are not the post author.";
}

?>

I tested this

<?php add_post_meta(postID, 'custom_field_name', Hello); ?>

and it works. I just don't know how to add an input field and a submit button to it. Can anybody help me out? Thank you!

I kept working on this and I got this far:

<?php $name = curPageURL(); 

echo $name;
?>

<form action="<?php echo $name; ?>" method="get">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form> 

<?php $thePostID = $post->ID; ?>

<?php add_post_meta($post->ID, $_GET["fname"], $_GET["age"]); ?>

But it still doesn't work :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.