I just tested the most recent version from github and that seems to work fine for me.
I tested calling register_field_group
in both a fuction called on the init hook, and right in a plugin file and they both seem to work fine. I think I’ll keep it in the init hook unless that’s a bad idea of some reason.
It might reduce problems down the line if you create a specific hook that people can use to call register_field_group
kind of like the posts to posts plugin does for their p2p_register_connection_type
and the p2p_init
hook. You could wrap the exported code in a function and include the hook right there so people wouldn’t have to do it themselves.
I know that’s not the issue I’m experiencing. Mine fails on code generated by 4.2.2. That issue, which I also experienced, completely broke my site because of the invalid php syntax.
No, sorry, that’s not the problem, the code is generated, but the fields I add with register_field_group never show up (either front or back-end). I was responding to your link. The issue in that link looked like it was when register_field_group was included in a theme file, I was just saying that I call register_field_group in a plugin.
I’ll try to test the most updated code from git-hub today if I get a chance.
I am including register_field_group in a plugin and that link looks like you were focusing on them being included in themes. I am just including register_field_group right in the plugin, should I be using a specific hook to call it instead?
@squarestarmedia, that’s a different bug that I also experienced (http://support.advancedcustomfields.com/forums/topic/export-fields-acf-4-3-0/), but that’s not what I’m experiencing here.
I have a development site where I create all my fields with the ACF user interface. The easiest way to make sure my live site and my development site are using the same fields is with the php export.
I have ACF installed as a normal plugin on both sites. On my live site I define ACF_LITE to true, then in a custom plugin, I check to see if ACF_LITE is true and I include a php file with the code from the php export.
In version 4.2.2 everything worked great. When I upgrade, it completely breaks, and by that I mean, I see NO fields in the admin section, and none of the fields are returned on the front end. When I revert back to 4.2.2 everything works fine again.
When I first attempted the upgrade, I also upgraded WordPress, so I reverted back to wordpress 3.6.1 and ACF 4.2.2. Since then I’ve upgraded wordpress and kept ACF the same, so I’m experiencing the same functionality on WP 3.6.1 and 3.7.1.
I just deactivated all plugins and reactivated them and that didn’t help.
I’m having this issue as well.
i.e. ‘instructions’ => __(‘Select the Team Member\’)s user account.’,
It completely breaks the code and causes the entire website not to work. I can go through and fix them though.
Thanks Elliot. I was a little behind, so I did update to 4.2.2, but the issue is still happening. I am using WP 3.6.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.