How do I remove registered custom types from the list of custom fields?

1

Good evening! I created some custom post types through the command register_post_type in wordpress, along with custom fields (post meta). The problem is that they appear along with the custom fields in the pages editing (how do I remove them from there?)

I would like the page editing to appear only in the custom fields of each page and not the fields I created for the post type.

    
asked by anonymous 20.10.2016 / 03:07

2 answers

2

Without seeing the code that creates the meta-boxes we just have to kick.

Probably somewhere in your code you have a call to add_meta_box() where the 4th parameter - $screen - is empty, false or has not been passed. If you put the name of the post_type it will only appear on the screens of that type.

    
20.10.2016 / 13:19
2

In order for your Custom Fields to not appear in a post / page / CPT list, you must use an underscore at the beginning of the name.

For example, this appears in the list: meu_custom_field . This no appears: _meu_custom_field .

    
23.05.2017 / 01:41