Hi, I’ve sped up our website GREATLY by using local JSON (thanks!) and noticed that https://www.advancedcustomfields.com/resources/register-fields-via-php/ describes that we can remove keys with default values and then “ACF will merge in the missing default settings.”
Does this apply to https://www.advancedcustomfields.com/resources/local-json/ too?
So:
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"maxlength": "",
"rows": "",
"new_lines": "wpautop",
"readonly": 0,
"disabled": 0
could be shortened to:
"new_lines": "wpautop",
TIA,
Gary
I don’t know if it applies, but I don’t think reducing the file size is going to save you more that a millisecond or 4. ACF is using file_get_contents(). I seriously doubt that the size of the file is going to matter much to this function since it’s all happening on the server. According to https://www.raditha.com/wiki/Readfile_vs_include/ it only takes .00564 seconds to read a 1MB file and only .00152 seconds to read a 32KB file.