Support » Plugin: Form to Post » Server-side filter for custom fields

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Michael Simpson


    I see that this is an oversight in the code. This hook allows you to change the inputs to the
    wp_insert_post call but the meta fields are not there. The meta fields are handled in a subsequent update_post_meta call after the post is created.

    So I added a new hook. Update to version 0.9 (should be available soon) then use this code:

    function form_to_post_set_meta($post) {
        $post['order-status'] = 'Order received';
        return $post;
    add_filter('form_to_post_before_update_post_meta', 'form_to_post_set_meta');

    That did it! Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Server-side filter for custom fields’ is closed to new replies.