If the data vanishes from your custom fields after saving your post, there are a few things you should check. Have you correctly hooked into the save_post
action in your index.php
file and are you passing it the correct arguments? Without your customized save function, WordPress will ignore the data in your custom fields.
When editing your post with custom fields, view the source HTML. Search for your $prefix
that you defined in your class. Are your form elements using this as part of the field names? You should see elements with names prefixed, for example:
<input type="text" name="custom_content_my_text" id="custom_content_my_text" value="" />
Next, you should see what's coming through after the form is posted. At the top of your save_custom_fields()
function, try printing the contents of the $_POST
array:
print_r($_POST);
Be sure to add some values to your custom fields and then resubmit the form. WordPress and won't be happy about it, but you can see if your...