How do I pass a post ID to the page URL?

I am trying to pass / append the POST ID of an AUTHORS POST to the end of a PAGE URL.

My effort so far to generate a link is as follows

<?php foreach(get_posts(array('author' => $author_id)) as $post)?>
<a href="http://example.com/dashboard/form_page?gform_post_id=<?php echo $post->ID ?>">Link</a>

But this seems to get first POST ID made on the site. Not the ID of the Authors POST. Note: It is a custom post id I am trying to get from the Author.

The Page URL is this: http://example.com/dashboard/form_page

What I am looking for is this: http://example.com/dashboard/form_page?gform_post_id=476

Where the POST ID is the ID of the POST Created by the Author logged in. (In my system only 1 post per Author)

Cheers in advance...

Plugin used: http://wordpress.org/extend/plugins/gravity-forms-update-post/

Answers


Try

<?php foreach(get_posts(array('author' => $author_id)) as $post) { ?>
    <a href="http://example.com/dashboard/form_page?gform_post_id=<?php echo $post->ID 
    ?>">Link</a>
<?php } ?>

Need Your Help

Why descendant-or-self:: is not allowed in template pattern?

xslt

Suppose I have the following XML (which is the embedding of TEI annotation scheme into HTML):

Surround SCM integration with Eclipse for Android project

android surroundscm

I have a bunch of code in Surround SCM, which I would like to get into a workspace in Eclipse. I will need to be able to work off of two branches. One for bug fixes, and one for new features, which...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.