I modified the code and placed it in my functions.php instead of a separate plugin. I also repeated the code (with customizations) for 2 post types – ‘product’ and ‘post’. The code works for the ‘product’ post type, but the data is not being saved on ‘post’ types.
Can someone look it over and help me figure out the problem? The code is below: