how to save to post meta without input box?
-
I made a plugin that takes value from input box and calculate results.
(Note: the plugin’s job is done during the porcess of post creating)I have the input box setup as post meta-box, so, I get the input value as post meta.
When there’s an input, the plugin will do calculation.
Now I need to save the calculated results into the post meta.
According to this code:
add_post_meta($post_id, $meta_key, $meta_value, $unique);
I will need $post_id.The problem is– when the post is not saved yet, is there a $post_id ?
If there is, how can I get it?Another question–
In BuddyPress, we have $bp->slug->var to express values. In WordPress, how to set up some variables like this?Thanks in advance for your time!
Regards
- The topic ‘how to save to post meta without input box?’ is closed to new replies.