0
votes

I am currently posting from the front end of wordpress using code I found here http://voodoopress.com/review-of-posting-from-front-end-form/

however I am using a few plugins that have thier fields in meta boxes on the backend that I can't seem to pass the data to from the front end form. One of the plugins is the wordpress facebook plugin http://wordpress.org/extend/plugins/facebook/ The field id like to have access to is the suggest-friends ID as it has ajax facebook auto complete for current friends as you type. Is this a possibility on the front end or am I attempting the impossible?

Thanks

1

1 Answers

0
votes

If I understand your question right, this is the function you need: http://codex.wordpress.org/Function_Reference/get_post_meta

The usage example they give in the documentation is this:

<?php $meta_values = get_post_meta($post_id, $key, $single); ?> 

For the first value, $post_id, you can follow this instruction:

$post_id is the ID of the post you want the meta values for. Use $post->ID to get a post's ID within the $post variable scope. Use get_the_ID() to retrieve the ID of the current item in the WordPress Loop

So if you are on your template page $post->ID would be fine.

Next, you need $key to be "suggest-friends"

Finally, $single set as true returns a string

So you can use this as your final result:

<?php 
$suggestFriends = get_post_meta($post->ID, 'suggest-friends', true);
echo 'The value of suggest-friends for this post is: '.$suggestFriends;
?>

Hope that helps!