eduardo-marcolino / acf-fields-in-custom-table

Stores ACF custom fields in a custom table instead of WordPress' core meta tables
27 stars 12 forks source link

Field Display Functions Do not work when Storage in WP_postmeta is Disabled #15

Open hmzisb opened 3 years ago

hmzisb commented 3 years ago

Hey there, thank you for developing this plugin. I noticed that when I disable wp_postmeta data storage acf display functions stop working. I guess they fetch the data from wp_meta. Is there a way around to keep those functions working?

eduardo-marcolino commented 3 years ago

Hi @hmzisb are you using the the ACF's default functions get_field and the_field?

JobMoll commented 2 years ago

I have the same problem.

load_field_from_custom_table($value, $post_id, $field) parameters are just empty it seems. See the result below.

{"value":null,"post_id":null,"field":{"ID":0,"key":"","label":"","name":"xyz_field_name","prefix":"","type":"","value":null,"menu_order":0,"instructions":"","required":false,"id":"","class":"","conditional_logic":false,"parent":0,"wrapper":{"width":"","class":"","id":""},"_name":"xyz_field_name","_valid":1}}

JobMoll commented 2 years ago

@hmzisb don't know if you need it but I wrote a super quick fix for it: https://github.com/JobMoll/acf-fields-in-custom-table

You do need to reinstall the plugin from here since I also add a custom options menu which it relies on.

Nowi5 commented 2 years ago

I can confirm this error, this is because the values seem to be stored twice, once in the meta table and once in the custom table, but it seems only to read from the meta table. @JobMoll your fork is not accessible.