@Ketri: i managed to work around this issue by creating page template for each page. I know it’s not as clean as you would like, but it may work 🙂
Also, if you use options addon, you could try the solution i described here: http://support.advancedcustomfields.com/forums/topic/wpml-and-acf-options/
Again, it’s not the most ideal thing, but… it works.
Aaaaand… Found the issue: https://github.com/elliotcondon/acf/commit/4a8aeb51c1d800938c5310e6673fd5cccc08d5fb#diff-e74ddde20ca493a4f8b1f2441d47bf4dR191
Hopefully will be quickly pushed 🙂
A little bit of update:
it seems that even i don’t have tabs, the JS responsible with this is this called. So if i disabled acf.fields.tab.show_tab_fields and acf.fields.tab.hide_tab_fields mehtods, things starts to work better (although still buggy). Keep diging.
Here is a very simple example: https://gist.github.com/069f7c64781a906fd02e
(and xml export: https://gist.github.com/2a0840fa93bdf898de56 )
AAAADN i nailed!
I created a little script that know to recreate fields from exported PHP file.
It can be seen here: https://github.com/iamntz/acf-recovery
Hopefully it will be helpful for others as well.
There is a way to fix existing exports too? I have a site to mantain with a lot of fields (somewhere between 50-80) and I don’t have anything else other than the export file.
// Edit
For example, i have this group: https://gist.github.com/iamntz/4818c3e9d5f7c0fdb2f6 (is one of the nine groups i have).
I tried the following:
1) Use Acf Recovery: https://github.com/seamusleahy/ACF-PHP-Recovery
2) Create a XML that resemble the WP export then import that xml
3) restored an old sql (which contains about half of the actual fields)
In all cases i only have one or two fields imported; e.g. Image Alignment (although, when i’m in the /edit.php?post_type=acf
page, the fields
column displays the correct number of fields (16)
However, the PHP export works just fine, fields are usable, there is no issue. is just… i can’t edit the fields.
In this moment i’m not very sure if the problem is on export, import or somewhere else.
I’m using WP 3.8 and latest github version of ACF.
Thanks!
I think i found the culprit: on local i had ACF 4.3.0 and on stage was 4.2.2.
It’s pretty weird, but… works now 🙂
I did. There is no other occurences.
That’s why i said it’s stupid 🙂
@flashpunk: here is how i did it:
1) Created a custom post type, named my_settings
. Obviously, is translatable by WPML
2) Created a page template for each settings page. Fortunate, i had only two pages. So, now we have tpl-home_carousel.php
and tpl-other_options.php
3) Created a page for each template. For now it’s enough to have them in base language (english)
4) Created an option page that sets the id’s for these pages. (there is a post object or something like this; you need the ID) (for the sake of simplicity, i named all options here as wpml_*
). We need this only for base language.
5) The old option pages (those with real … options) are now set as to be displayed on certain templates (those that we set earlier)
Done with admin!
Right now, we need a way to get the id for get_field('our_awesome_setting', ID)
function.
We first get the ID for base language page:
$home_carousel = get_field( 'wpml_options_home_carousel_page', 'option' );
We then get the translated page (or base page if there is no translation):
$home_carousel_id = icl_object_id( $home_carousel->ID, 'my_settings', true, ICL_LANGUAGE_CODE );
Then we set a constant with this translated ID:
define( 'MY_OPTIONS_HOME_CAROUSEL', $home_carousel_id );
After this, everything is just fine. We can get fields as usual, but instead of using option
param, you use this constant we defined earlier:
$gallery_rows = get_field( 'home_gallery_rows', MY_OPTIONS_HOME_CAROUSEL );
Done!
(let me know if i explained well)
Very, very late edit: you can set templates to custom post types by using this plugin: http://wordpress.org/plugins/custom-post-type-page-template/
Hmmm, a new page could work. Let’s see!
Thanks!
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.