Home Forums Backend Issues (wp-admin) How to create a new input field type as an array?


How to create a new input field type as an array?

  • Hello all,

    I’m trying to to create an input field type that will be an array (it’s for products inside of a category, the category would probably be my array name).

    I’m trying to figure out how to do it, but I can’t figure it out. Can someone help?


  • Old question and you’ve probably either found a solution or moved on.

    For others looking at this type of work, there are several fields in ACF that store arrays. There are also other fields that return arrays of information but do not actually store those arrays. There are also fields that are a combinations. For example the Taxonomy field when set to allow multiple selections stores and array of Term IDs in the database. The field can also be set to return Term Object. These objects are not actually stored in the DB, it still just stores the IDs and the terms are constructed by the format_value() method of the field type.

    My first step in building a new field type would be to look at the existing field type coding, especially the ones that do something similar to what you want to do, and then use what you find as an example while building the new field type.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘How to create a new input field type as an array?’ is closed to new replies.