Hi.
I have a price field (number) in custom post type.
How to automatically update the value in all posts by the formula price*coefficient. Coefficient I set on the options page
The only way to update the value in all posts is to do a query to get all of the posts and loop over them and set the new value for each post in the loop.
Depending on the number of posts you have this could potentially just time out and fail.
Is it necessary to actually store the calculated value? Why are you storing a calculated value? Not saying you don’t need to store the value, I just want to understand why it’s needed and that might provide ideas on how to work around the limits.
This is required for a directory where there are 2 currencies. Currency is calculated by the exchange rate. The site has a filter for one of the currencies, but when creating a post, the value is set in different currencies
Do you do any kind of a search or filtering based on the calculated value?