Hot answers tagged


You got it quite right, but with a few minor problems. First, please use a uniqe prefix for your functions and values - opacity or meta_save are quite generic and could be used by other authors. Second, the part where you get the meta opacity was missing, I added it for you - just retrieve the meta value from the current post. Third, I then created a ...


I would add another custom field that stores the update time. Then create an add_action function for update_post_meta to also save the timestamp at the same time you write to CUSTOMFIELD. The action triggered when adding a custom field is add_post_meta and when updating a custom field update_post_meta


I don't know what are you trying to achieve, but in my mind and opinion, you are definitely on the wrong track here. When a custom field is updated, nothing happens to the actual post object as custom fields aren't part of the WP_Post object. This means that no actions are triggered related to updating the post object itself, and therefor the post_modified ...

Only top voted, non community-wiki answers of a minimum length are eligible