Server-side filter for custom fields
-
I’d like to set a custom field, “current-status”, to “Order received” in all instances. This can be done easily by using a CF7 shortcode [text meta_current-status "Order received"]. But seeing as how the value is the same for every user, I’d rather set this on the back end.
So I thought I’d add a filter into functions.php:
function form_to_post_set_values($post) { $post['meta_order-status'] = 'Order received'; return $post; } add_filter('form_to_post_before_create_post', 'form_to_post_set_values')
Obviously, this did not work but I think you can see what I’m trying to do here. Any suggestions?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Server-side filter for custom fields’ is closed to new replies.