admin管理员组

文章数量:1332865

At post meta I have two meta keys: 'old_views' and 'new_views', so I need a function to get the total value of these both combined and save it as a new meta key called 'total_views'.

For example:

'old_views' = 100

'new_views' = 400

'total_views' = 500

Note: Only the value from 'new_views' will be increment every time a post gets visited. 'old_views' won't be incremented anymore, but I still need to sum both values for old posts published.

本文标签: How to get the total of two meta values from different meta keys