0

I need to have custom fields for each post and terms. But how can I create these fields which don't update when post or terms is updated in backend.

For example:

Lets suppose we have a custom field named "revenue" for custom post type "product".

Now due to actions/transaction of user on the front end the value in the field "revenue" for a post(ID = 7) is 2500..

Then some one decides to edit some other data in this post(ID = 7) and try to edit the post in backend. i.e this post is being in edit mode for suppose 5 minutes.

In those 5 minutes 3 transactions occur in front end so the actual value in the field "revenue' is 4000

But since the post is in edit mode and value there is only 2500 and the use updates post ..

so now after the update the value in the field "revenue" is 2500 instead of 4000

so how can I avoid that Do I need to create some different kind of custom fields ? or do I need to have something other than custom fields to hold this data

Can you please advice me how to proceed with this

1
  • Maybe save the revenue post-meta to a different post-type (product_meta might be a good name), then link it to the product post-type to be via post-id? terms could be done the same way and the product_meta post-type could be private, or depending on the use-case have it's archive disabled and single-views redirected.
    – admcfajn
    Jul 6 at 4:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.