2

I've added a custom textarea for the create/edit post admin page. I did so using the add_meta_box() function. The problem is that the add_meta_box() callback function (which saves the data input into the textarea) calls the update_post_meta(). update_post_meta() then adds a custom field within the custom field section. So you essential end up with two textareas for the same field! The one you've created and the auto generated one!

Is there a way to remove the auto generated custom field?

Thanks, Jon

1 Answer 1

1

If the meta field starts with an underscore, it will be hidden in the interface by adding the class hidden to the <tr> element. You could also apply this class by yourself using Javascript, the <tr> element has an id of meta-{$custom_field_id}.

1
  • 1
    Hi Jan. Thanks for the reply. Prefixing the name with and underscore hides the auto generated custom field AND the manually added meta box! So that's no good really.
    – Jon
    Sep 3, 2010 at 11:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.