FAQ

Just Custom Fields

How does the plugin save fields configuration?

The Just Custom Fields plugin can save fieldsets configuration in two different ways. In the site database or in the file system. In turn, saving fieldsets in a file can be done in two different locations.

JCF-jsonsettings-640x259 How does the plugin save fields configuration?

Consider these options in more detail.

  1. The database fields settings are stored in the options table (remember that WordPress adds prefixes for tables, the default prefix is wp_, so the table name will be wp_options by default). The plugin creates 2 database rows with option_name equals jcf-fieldsets and jcf-fields. There is an array of fieldsets settings stored in the jcf-fieldsets row grouped by the post types and their visibility options. Also, each fieldset has an array of related field internal IDs. The jcf-fields row has an array of fields settings indexed by internal field IDs.
  2. Fieldsets are stored in the JSON format in the file system settings. The file can be saved either in the active theme folder or in the wp-content folder. In both cases, a sub-folder, jcf-settings, is created where the files are saved.

File system storage can be effective when more that one developer is working on a project and it’s very useful to share new settings with a version control repository. This option helps to have a legitimate version in one place. It is also useful when you upload on the site with FTP/SSH to production.

The Theme folder option is useful for multisites. Each blog in multisite installation can have a different theme and different fields settings, which are easily visible inside the JSON file for each theme.

Problems may be incurred with the fieldset visibility settings while moving settings between different WordPress installations.
If you use visibility settings, based on taxonomy terms, there is a possibility that the taxonomy term_id doesn’t match in different WordPress sites.

You should also know that created fields are not transferred when you change the storage method. This is done to avoid errors when merging sets of fields. You can use the import/ export service of our plugin to transfer the fields.

Please find the JSON format example below (database options uses the same format of arrays).

{
    "fieldsets": {
        "agenda": {
            "agenda-settings": {
                "id": "agenda-settings",
                "title": "Agenda Settings",
                "position": null,
                "priority": null,
                "fields": {
                    "textarea-1477586885": 1,
                    "datepicker-1477587221": "datepicker-1477587221",
                    "checkbox-1477587288": 1,
                    "select-1477924592": 1,
                    "selectmultiple-1478025415": 1
                }
            },
            "agenda-images": {
                "id": "agenda-images",
                "title": "Additional Information",
                "position": "advanced",
                "priority": "default",
                "fields": {
                    "collection-1477587372": 1,
                    "relatedcontent-1477587794": 1
                }
            },
            "realtor-information": {
                "id": "realtor-information",
                "title": "Realtor Information",
                "position": null,
                "priority": null,
                "fields": {
                    "inputtext-1477587658": "inputtext-1477587658",
                    "simplemedia-1477587704": "simplemedia-1477587704",
                    "table-1477587644": 1
                }
            }
        }
    },
    "fields": {
        "agenda": {
            "textarea-1477586885": {
                "title": "Address",
                "editor": 0,
                "description": "",
                "slug": "_advert_address",
                "enabled": 1,
                "_version": "3.000",
                "_type": "textarea"
            },
            "datepicker-1477587221": {
                "title": "Release Date",
                "show_monthes": 0,
                "date_format": "yy-mm-dd",
                "slug": "_release_date",
                "enabled": 1,
                "_version": "3.000",
                "_type": "datepicker"
            },
            "checkbox-1477587288": {
                "title": "Featured Advert",
                "settings": "Hot|hot\nNew|new\nSale|sale",
                "description": "",
                "slug": "_hot_advert",
                "enabled": 1,
                "_version": "3.000",
                "_type": "checkbox"
            },
            "collection-1477587372": {
                "title": "Advert Additional Image",
                "slug": "_advert_additional_image",
                "enabled": 1,
                "_version": "3.000",
                "_type": "collection",
                "fields": {
                    "inputtext-1477587392": {
                        "title": "Image Title",
                        "description": "",
                        "slug": "_title",
                        "enabled": 1,
                        "group_title": 0,
                        "_version": "3.000",
                        "_type": "inputtext",
                        "field_width": "75"
                    },
                    "checkbox-1477587426": {
                        "title": "Image Visibility",
                        "settings": "Enabled|enable",
                        "description": "",
                        "slug": "_enabled",
                        "enabled": 1,
                        "_version": "3.000",
                        "_type": "checkbox",
                        "field_width": "25"
                    },
                    "simplemedia-1477587443": {
                        "title": "Select Image",
                        "type": "image",
                        "description": "",
                        "slug": "_image",
                        "enabled": 1,
                        "_version": "3.000",
                        "_type": "simplemedia",
                        "field_width": "25"
                    },
                    "textarea-1477587464": {
                        "title": "Image Description",
                        "editor": 0,
                        "description": "",
                        "slug": "_description",
                        "enabled": 1,
                        "_version": "3.000",
                        "_type": "textarea",
                        "field_width": "75"
                    }
                }
            },
            "table-1477587644": {
                "title": "Contact Info",
                "columns": "title|Contact Title\ncontent|Content\ntime|Time for contact",
                "description": "",
                "slug": "_realtor_contacts",
                "enabled": 1,
                "_version": "3.000",
                "_type": "table"
            },
            "inputtext-1477587658": {
                "title": "Realtors Name",
                "description": "",
                "slug": "_realtors_name",
                "enabled": 1,
                "group_title": 0,
                "_version": "3.000",
                "_type": "inputtext"
            },
            "simplemedia-1477587704": {
                "title": "Photo",
                "type": "image",
                "description": "",
                "slug": "_realtor_photo",
                "enabled": 1,
                "_version": "3.000",
                "_type": "simplemedia"
            },
            "relatedcontent-1477587794": {
                "title": "Related Advert",
                "post_type": "agenda",
                "input_type": "autocomplete",
                "description": "Start typing entry Title to see the list.",
                "slug": "_related_advert",
                "enabled": 1,
                "_version": "3.000",
                "_type": "relatedcontent"
            },
            "select-1477924592": {
                "title": "Type",
                "options": "House\nResidential\nViticulture\nStudio\nLifestyle\nOther",
                "description": "",
                "empty_option": "",
                "slug": "_adver_type",
                "enabled": 1,
                "_version": "3.000",
                "_type": "select"
            },
            "selectmultiple-1478025415": {
                "title": "Type",
                "options": "House\nResidential\nViticulture\nStudio\nLifestyle\nOther",
                "description": "",
                "slug": "_advert_mselect",
                "enabled": 1,
                "_version": "3.000",
                "_type": "selectmultiple"
            }
        }
    }
}