Support

Account

Forum Replies Created

  • The makes field in the “vehicle types” post type populates the available “makes” choices for the vehicle post types. So they’re not editable on the same post, but one references the other, so that’s probably why the loop was happening. Yes, I could have avoided the problem by referencing field keys instead, good point. In this case I just changed one of the field names.

  • Thanks for the suggestions. You set me on the right path. I had wp_reset_postdata in there originally but I guess I deleted it when I trimmed down my code.

    I can’t believe that I didn’t notice I was using add_action when I should have been using add_filter. Glad you pointed that out or I would have had even more problems. Turns out though, that isn’t actually what was at the root of my problem either.

    I *think* that I’ve figured this out. I say this a bit hesitantly because I have had no end of problems with this particular item. It would appear that the problem was, having two fields with the same name referencing them. Basically even after I changed it to add_filter I was still having the same problem, but I noticed that I was able to work around the problem by using get_post_meta instead. But the data being returned was wrong.

    Long story short, I opened up the field group, noticed a whole bunch of field groups, and then had the sudden “eureka” moment that two fields being referenced had the same name and might be stepping on each others’ toes. Sure enough when I update the field names so that they are not identical, things start working as they should. Or at least, so it would seem. I guess if you have a filter applied to acf/load_field/name=make then it gets applied to all fields with that name. Which makes total sense.

  • To follow up on this, I am getting a php error:

    Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html2/wp-includes/functions.php on line 3583

  • Thanks, I saw this in my searches and tried implementing something like it but had no luck. I’m going to try setting it up on a clean installation and take a closer look at what it’s doing to see if I can use it for what I need. I’ll let you know how it goes.

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