Support

Account

Home Forums Backend Issues (wp-admin) ACF-heavy site shows no Field Groups in admin list, trying to understand how

Solving

ACF-heavy site shows no Field Groups in admin list, trying to understand how

  • ACF-Pro registered dev here,

    I have inherited an ACF-based (have not yet upgraded it to ACF Pro like the rest of our sites) WP site made in 2014. It’s heavy w/ ACF, but it’s framed in an unusual way.

    There are no Field Groups listed under the WP Admin / Custom Fields menu.

    What the dev has done is created a custom post type called Sections. When one creates or edits a section they are presented with an ACF-created admin form that allows the user to enter title for the post, etc. as well as select from a list, various “Module Type”s — these are ACF-created modules. The user chooses from a list of posts, which posts this Section should be attached to. So, basically the dev has created an ACF-based admin page that perhaps makes it a bit easier or shorter a process of attaching tile, content, and ACF module to a page.

    Here is a screenshot of this Sections admin page, ACF-created.

    http://blakespot.com/images/WP_sections_fullpage.png
    ( Please copy / paste this into browser address bar — this forum’s software seems not to be opening the image for some reason – thanks. )

    I have been tasked with recreating this approach for a new site we are building, but I can’t figure out how the orig dev created these various ACF modules or the ACF-based admin menu without anything being listed under Custom Fields in the ACF area of the admin. I can’t figure out how to “get a handle” on the ACF pieces the dev made, including the admin menu of Sections. Are the ACF modules explicitly hidden from the ACF menu area? Note the menu is still there, it’s just that it comes up empty (well, only w/ modules I’ve made recently), when opened.

    Does anyone have any idea how I can figure out what’s going on here?

    It’s worth noting that the site is running the Admin Menu Editor plugin, which it would seem may have been involved in this, but which one of the orig devs on the project with whom I had a very short chat, said he felt it was not involved in setting up the Sections area. (He may be incorrect)

    I have been poring over the code, templates, and scoring the DB directly for almost a week trying to figure out how this is tied together. Has anyone ever seen anything like this?

    Many thanks.

    UPDATE: I found the code that renders out the “Module Types” to a page — looks like they went full manual on this. Querying DB directly looking for “Sections” that have current page as parent, and rendering with explicit render functions. Code is here (note that getChildSections() is called on page templates that use these Sections):

    http://pastebin.com/h20URPAD

    I just can’t figure out how they created these modules. I can’t see how ACF’s Field Group creation interface was used, because where do these fields live? Surely they didn’t go into MySQL manually and create a row in postmeta containing a field name to manipulate with the code above. What would be the purpose of using ACF at all for that, at that level of manual work?

  • Hi @blakespot

    It seems the original developers registered the fields via PHP. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/register-fields-via-php/. All of the fields registered via PHP won’t show up on the field group editor page; that’s why you couldn’t find it there.

    It’s also possible that they use the Local JSON feature and hides the field group using the “private” option. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/synchronized-json/.

    I hope this helps 🙂

  • Thanks for the help, James.

    Unfortunately, none of the functions that start with “acf_” are present in any of the code anywhere in my theme directory. As well, I don’t see a json directory either. What else could be going on here?

    I am baffled as to how these fields / groups were created. And, as such, quite roadblocked in creating this system anew for another web project.

    Any further help much appreciated. Thanks.

  • Hi @blakespot

    If he doesn’t use PHP code nor the Local JSON feature, then there’s nothing else I can help you. The best way to find it is to ask the original developer as he can do anything he wants, and we wouldn’t know about it at all.

    Also, please keep in mind that you can set different place to save the JSON files. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/local-json/#saving-explained.

    Another thing you should check is if he used a plugin instead of the theme to add the fields. In this case, you can try to check if the fields show up on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated. If it disappears, then you can activate the theme and plugins one by one to see which one that adds the fields.

    I hope this makes sense 🙂

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

You must be logged in to reply to this topic.