2
votes

I am creating a plugin in Wordpress with a custom post type and custom fields. I have enabled the default Wordpress custom fields metabox for my post type, but I would like to customize some of the output:

  • Limit the Custom Field Name select list to only include fields that have been added to my custom post type (Don't include custom fields added to other post types).
  • Exclude custom fields added to only my custom post type from all other post types (Don't include them in the Custom Field Name select box for other post types).
  • Change the Custom Fields metabox title ("Custom Fields"), label ("Add New Custom Field"), button ("Add Custom Field"), and description ("Custom fields can be used to add extra metadata...")

Basically, I am trying to leverage the Wordpress unlimited custom fields functionality for my custom post type, but I want to customize it to the needs of one specific custom post type.

Can this be done? (I do not want to use Advanced Custom Fields for this.)

1

1 Answers

0
votes

A good alternative to Advanced Custom Fields is Simple Fields: http://simple-fields.com/ It allows you to make field groups and then use Post Connecters to link them to certain post types. This will allow you to link only desired fields to your custom post types (point 1), and therefore not show the fields on other post types (point 2). You can also title the field group and labels however you like (point 3).