Suppose i have a function

function mytable(){
$count_value = get_kudos_count( $post_id ); }

How to send $count_value dynamically to the custom field present in WordPress post ?

Let us assume the custom field name (key) is custom_count

1 Answer 1


You can use update_post_meta:

update_post_meta( $post_id, 'custom_count', $count_value );
  • can you briefly explain it. where i should place the function, and send the output values to the field custom_count. Sep 14, 2015 at 5:28
  • I have no idea what the purpose of your function is, so I don't know where you need to put it.
    – Milo
    Sep 14, 2015 at 5:47
  • It worked, since i am using ACF plugin i used update_field() function. Sep 14, 2015 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.