Let me see if I can simplify. I think this boils down to
1. you have a field in a form that gives a number X
2. you want to inject [star rating=”X”] in the post
I’m assuming here that you don’t need to use a custom field.
I propose this: We will set the value to something that F2P can pick up, and will add PHP filter code to set the short code in the post.
1. Change the name of the star rating field in your form definition to “pinged”. This is a hack to get F2P to pick it up. That is a field is used to create a form, but we are going to hijack the name just to pass the value and grab it. (A limitation of my plugin that I should address at some point)
2. Using Add Shortcodes Actions and Filters plugin, add a filter:
function form_to_post_add_start_rating($post) {
// get the start rating value
$num = $post['pinged'];
// remove phony pinged field
unset( $post['pinged']);
// Inject the shortcode at the beginning of the post contents
$post['post_content'] = "[star rating=\"$num\"]" . $post['post_content'];
return $post;
}
add_filter('form_to_post_before_create_post', 'form_to_post_add_start_rating');