Hey, there, I’m a developer and making a plugin for some ACF + WPML functionality.
It’s purpose is to allow user adding a field translation directly from main version.
So I made a button for each text/textarea/wysiwyg field with `acf.addAction(“ready_field/….. {
jQuery(this).append(
‘<div class=”pat_button button”>TRANSLATE</div>’
);
}`
which on click makes an ajax call and loads all the translated values by field key:
jQuery(".pat_button").on("click", function () {
var field_id = jQuery(this).parent().parent().attr("data-key");
}
$post_id = $_POST['post_id'];
$post_type = $_POST['post_type'];
$field_id = $_POST['field_id'];
$languages = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' );
foreach($languages as $key => $value) {
$languages[$key] = array();
$languages[$key]['dest_post_id'] = apply_filters( 'wpml_object_id', $post_id, $post_type, FALSE, $key );
$languages[$key]['dest_field_id'] = $field_id;
$languages[$key]['field_val'] = get_field($field_id,$languages[$key]['dest_post_id']);
}
echo json_encode($languages);
wp_die();
It’s kinda working for top-level fields and I can see those textareas are filled with values properly:
However, when it comes to nested inputs,textareas and wysiwyg inside repeaters or flexible content I get empty values. Probably because I have to conditionally use get_field and get_subfield for different inputs.
However, how can I implement such conditional usage? It feels a bit complicated to use has_rows() for my case. is there a way to get ‘meta key’ with javascript api from field.data so I can get_post_meta/update_post_meta instead of get_field/update_field?
I have a repeater field “Translators”, which has a child text field “Translator”. I am using wpml. In english there is no value for the field, however in French there is a value. In my template file I check has_rows(‘Translator’). It returns false on both the english and french versions of the page even though there is a value for the french page. If I add a value to the english page, then it works. How can I check to see if a value exists in the current language in the template?
Hi ACF team
Your plugin is doing a great job on our website. But there is one thing that I cannot get working.
– I have some woocommerce products
– I allready translated the products from Dutch to English
– After that I added a couple of ACF fields to the product page. To be exactly: radio buttons. I added them at both languages and I translated them too.
What do I want to achieve:
The radio buttons are there so I can let the admin user select, when a product is out of stock, when the product is in stock again. So the admin user can select a month a month part and a year.
I want to achieve that the admin user has to fill in the radio buttons at one language. So the other language will sync the radio button status.
But that’s the problem.
At the bottom of the admin product page I can change some WPML settings. For example the ACF field month I can select:
– Don’t translate
– Copy
– Copy once
– Translate
When I choose translate, the translation is fine but the radio button status isn’t synced between both languages
When I choose copy, the radio buttons are synced between both languages, but there is no translation
Can you tell me how I can sync en translate at the same time? Is it even possible?
I hope I hear you soon.
Best regards,
Mark
Solution:
[code]
function duplicate_post_to_secondary_language( $post_id, $mark_as_duplicate = false ) {
// Retrieve the post's element type, trid, and existing translations
$element_type = apply_filters( 'wpml_element_type', get_post_type( $post_id ) );
$trid = apply_filters( 'wpml_element_trid', null, $post_id, $element_type );
$translations = (array) apply_filters( 'wpml_get_element_translations', [], $trid, $element_type );
if ( ! $translations ) {
// Handle error or invalid values accordingly
return;
}
// Retrieve the active languages
$wpml_languages = (array) apply_filters('wpml_active_languages', [], 'orderby=id&order=desc');
foreach ( $wpml_languages as $language ) {
// Duplicate the post if no translation exists for the given language
if ( ! isset( $translations[ $language['language_code'] ] ) ) {
apply_filters(
'wpml_copy_post_to_language',
$post_id,
$language['language_code'],
$mark_as_duplicate
);
}
}
}
add_action('acf/save_post', 'duplicate_post_to_secondary_language', 20);
@vueloiv Take a look into the “name” keys of the configured fields.
WPML stores them into a configuration array like this:
[
// 'meta_key' => 'translation option'
'my_custom_field' => 2 //translate
]
If there are fields with the same “name” (meta_keys) the setting will be overwritten.
Field name in documentation
I recommend to use unique names
You would need to talk to WPML about translation setting for “time”, it appears that the document you linked to only covers date formatting.
I have no idea what the problem is, but that should work for time too?
https://wpml.org/documentation/getting-started-guide/translating-your-sites-date-format-using-wpml/
Hello,
I have a site in wordpress with wpml and acf plugins.
I have a custom field group in my site and i have included some custom fields inside it with various types (text, image, text area etc). One of them is type Flexible Content and i have defined 2 text sub_fields inside it. The issue that i have come across, is when i try to retrieve data from this sub_field in any language except of english, it is returned the key name not the absolute name i have set in these fields.
For example
These are the the properties of my sub-field of flexible content field
{
“key”: “field_63d3e86dc6b86”,
“label”: “Title”,
“name”: “title”,
“aria-label”: “”,
“type”: “text”,
“instructions”: “”,
“required”: 0,
“conditional_logic”: 0,
..
etc. }
In english i have this data returned as below (as i wanted to be)
[//flexible content field
{
“acf_fc_layout”: “”,
“title”: “test”, //text sub-field with name title
“image”: “test1”, //text sub-field with name image
}
],
In any other language:
{
“acf_fc_layout”: “”,
“field_63d3e86dc6b86”: “test”, //instead of title is returned field_63d3e86dc6b86
“field_63d3e86dcd5”: “test1”,//instead of image is returned field_63d3e86dcd5
}
],
I have not figured out why this happening, as i have set the same sub_field names in all languages.Any ideas? Thanks in advance!!
I fixed it by hardcoding jquery translation-strings 🙂
Eg:
<?php
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
if($my_current_lang == 'en') {
?>
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
<script>
$( document ).ready(function() {
$("form .class").html($("form .class").html().replace('Original string','New string'));
</script>
<?php
}
?>
Used versions: WPML 4.5.11, ACF Pro 6.0.0, WordPress 6.0.2, Advanced Custom Fields Multilingual 1.10.4
When I use the WPML standard or advanced translation editor, WPML creates only one entry for the field name in wp_postmeta like this:
meta_key = ‘my_field_name’, meta_value = ‘the value’
Unfortunately this means that the ACF get_fields() function cannot return any fields. get_fields() requires an additional entry in the wp_postmeta for each field connecting the field key and the field name:
meta_key = ‘_my_field_name’, meta_value = ‘field_my_field_key’
If I then manually edit the translated post and save it again, these missing entries are generated by ACF and the get_fields() function works correctly.
Is there any way to generate these meta data per ACF function call? I have helped myself so far by writing each field again with update_field, but this costs unnecessary time.
And is this misbehavior of WPML actually known? Is there a solution?
Forgot to mention the versions:
ACF PRO Version 5.12.1
WPML Version 4.5.8
ACFML (compatibility plugin for ACF and WPML) Version 1.10.3
Hi there,
Honestly, I don’t remember exactly what I did, but this code works now (I might have had to recreate the fields)
<?php
$my_current_lang = apply_filters( ‘wpml_current_language’, null );
// $queried_object = get_queried_object();
// var_dump( $queried_object );
?>
<?php
$loop = new WP_Query(
array(
'post_type' => 'page',
'post__in' => array( 21 ),
)
);
?>
<?php
while ( $loop->have_posts() ) :
$loop->the_post();
$rolunkbg = get_field( 'aboutus_bg' );
$rolunktext = get_field( 'aboutus_text' );
?>
<div class="container-fluid bg1 slanted2" style=" background-image:url('<?php echo wp_get_attachment_url( $rolunkbg ); ?>">
<div class="container tagline">
<h4 class="tagline--description"><?php echo $rolunktext; ?></h4>
<?php endwhile; ?>
<!-- ;" width="45"> -->
<h2 class="tagline--h2 tagline--transparent">
<?php
if ( $my_current_lang == 'en' ) {
?>
<!-- ABOUT US -->
<?php
} else {
?>
<!-- Rólunk -->
<?php
}
?>
</h2>
<h3 class="tagline--subheadline pt-2 text-center">
<?php
if ( $my_current_lang == 'en' ) {
?>
A professzionális audiovizuális megoldások forrása.
<?php
} else {
?>
A professzionális audiovizuális megoldások forrása.
<?php
}
?>
</h3>
<h2 class="tagline--h2">
<?php
if ( $my_current_lang == 'en' ) {
?>
<!-- ABOUT US -->
<?php
} else {
?>
<!-- Rólunk -->
<?php
}
?>
</h2>
<?php if ( $my_current_lang == 'en' ) { ?>
<div class="row">
<div class="col-3"></div>
<div class="col-6"><a href="about">
<div class="btn-primary text-center">About us</div>
</a></div>
<div class="col-3"></div>
</div>
<?php } ?>
<?php if ( $my_current_lang == 'hu' ) { ?>
<div class="row">
<div class="col-3"></div>
<div class="col-6"><a href="rolunk">
<div class="btn-primary text-center">Rólunk</div>
</a></div>
<div class="col-3"></div>
</div>
<?php } ?>
</div>
</div>
Let me know if it does not help and I’ll check if I needed to change something with the fields in admin.
You mean “Translation preferences” function comes from WPML and not from ACF PRO?
You should probably be contacting WPML. Advanced Custom Fields Multilingual belongs to them.
Is hardcoding your array of options a viable solution?
$project_scope = array(
'key1' => __('value1', 'text-domain'),
'key2' => __('value2', 'text-domain'),
'key3' => __('value3', 'text-domain'),
)
WPML string translation could scan all values wrapped in __() and you can easily translate them.
If you still want these values to be available in an ACF select field, you can dynamically populate that field using the same source:
add_filter('acf/load_field/name=project_scope', 'my_project_scope_options');
function my_project_scope_options( $field ) {
global $project_scope;
$field['choices'] = $project_scope; //You can do this because it already is an associative array
return $field;
}
Hi ! I also add an error generated with the above code, so I modified it using the date_i18n function so the date will be translated corresponding to your language. (it worked with wpml)
Please note that for this to work, the format of your acf date field (for template) must be this type :
20211010 Ymd
As above, the syntax of the Shortcode is the same :
[acf_date field='date_field' date_format='M j, Y']
—
function acf_date_shortcode( $atts )
{
extract( shortcode_atts( array(
'field' => '',
'post_id' => false,
'format_value' => true,
'date_format' => ''
), $atts ) );
$acf_date = get_field( $field, $post_id, $format_value );
$value = date_i18n( $date_format,strtotime($acf_date) );
return $value;
}
add_shortcode( 'acf_date', 'acf_date_shortcode' );
@lgladdy
I use locally
Wordpress 5.8.1
ACF version 5.10.2
Advanced Custom Fields Multilingual 1.9.1
WPML Media 2.6.5
WPML Multilingual CMS 4.4.12
WPML String Translation 3.1.10
WPML Translation Management 2.10.8.
When I save my custom widget, the widget get the ID media_widget-1
but the saved options receive the ID widget_media_widget-12
Workflow:
<input class="widget-id" type="hidden" name="widget-id" value="media_widget-12">
<– maybe the ID should be 1 not 12Update
media_widget-1
:<input class="widget-id" type="hidden" name="widget-id" value="media_widget-1">
Hope this will help.
Mention to us what you are attempting to do in German language?
My site utilizes ACF Pro in the back end.
I have a gathering field with 3 subfields:
1. A radio catch. which shouldn’t be deciphered. I just need to get to the catch esteem picked by the site’s manager. This worth is something very similar for any language.
I set this present field’s Translation inclinations to duplicate
2 and 3. Picture handle each. a similar picture can be utilized in any of the dialects, yet it’s Alt, Captions, and title tag ought to be deciphered (which btw, is the situation for all media in my site).
Interpretation inclinations for these two picture fields: not certain what to utilize?
Furthermore there’s simply the interpretation inclinations for the gathering field itself. Which confounds me, since I’m as of now being approached to set the inclinations for each of the subfields.
When
Is there any documentation that you are following?
Your docs.
My seetings are
* Dashboard > WPML > Settings > Post Types Translation checked the ‘Translatable – use interpretation if accessible or fallback to default language’ for the Media (connection)’ post sort.
* Dashboard > WPML > Settings > Media Translation > How to deal with media for new substance: checked ‘While transferring media to the Media library, make it accessible in all dialects’ and different ones are unchecked.
Hi,
Mention to us what you are attempting to do in German Language?
My site utilizes ACF Pro in the back end.
I have a gathering field with 3 subfields:
1. A radio catch. which shouldn’t be deciphered. I just need to get to the catch esteem picked by the site’s manager. This worth is something very similar for any language.
I set this present field’s Translation inclinations to duplicate
2 and 3. Picture handle each. a similar picture can be utilized in any of the dialects, yet it’s Alt, Captions, and title tag ought to be deciphered (which btw, is the situation for all media in my site).
Interpretation inclinations for these two picture fields: not certain what to utilize?
Furthermore there’s simply the interpretation inclinations for the gathering field itself. Which confounds me, since I’m as of now being approached to set the inclinations for each of the subfields.
When
Is there any documentation that you are following?
Your docs.
My seetings are
* Dashboard > WPML > Settings > Post Types Translation checked the ‘Translatable – use interpretation if accessible or fallback to default language’ for the Media (connection)’ post sort.
* Dashboard > WPML > Settings > Media Translation > How to deal with media for new substance: checked ‘While transferring media to the Media library, make it accessible in all dialects’ and different ones are unchecked.
Hi,
Mention to us what you are attempting to do in the German Language?
My site utilizes ACF Pro in the back end.
I have a gathering field with 3 subfields:
1. A radio catch. which shouldn’t be deciphered. I just need to get to the catch esteem picked by the site’s manager. This worth is something very similar for any language.
I set this present field’s Translation inclinations to duplicate
2 and 3. Picture handle each. a similar picture can be utilized in any of the dialects, yet it’s Alt, Captions, and title tag ought to be deciphered (which btw, is the situation for all media in my site).
Interpretation inclinations for these two picture fields: not certain what to utilize?
Furthermore there’s simply the interpretation inclinations for the gathering field itself. Which confounds me, since I’m as of now being approached to set the inclinations for each of the subfields.
When
Is there any documentation that you are following?
Your docs.
My seetings are
* Dashboard > WPML > Settings > Post Types Translation checked the ‘Translatable – use interpretation if accessible or fallback to default language’ for the Media (connection)’ post sort.
* Dashboard > WPML > Settings > Media Translation > How to deal with media for new substance: checked ‘While transferring media to the Media library, make it accessible in all dialects’ and different ones are unchecked.
Hello,
Building on the previous solution with a more generic one, dropping this in our functions.php file fixed all galleries on the site:
add_filter( 'acf/format_value/type=gallery', 'fix_gallery_order', 100, 3 );
function fix_gallery_order($value, $post_id, $field){
$order = get_field($field['name'], $post_id, false);
if(is_array($order)){
$order = array_map(function($id){
return apply_filters('wpml_object_id', $id, 'attachment', true);
}, $order);
usort($value, function($a, $b) use ($order){
return array_search($a['ID'], $order) - array_search($b['ID'], $order);
});
}
return $value;
}
Hi John!
Reading post object, in the end it will be around 20+ different post objects and 5-10 different categories. Each category will have 5-20 post objects.
See below if this make sense.
$post_object = get_field('post_object_categoryONE_1','options')
$post_object_2 = get_field('post_object_categoryTWO_1','options')
And this is the code part we are referring to:
$post_object = get_field('post_object_categoryone_1','options'); // Set field to grab
if( !empty ($post_object) );
$imageArray_BG = get_field('post_hero_img_1', $post_object->ID); // Array returned by Advanced Custom Fields
$imageAlt_BG = esc_attr($imageArray_BG['alt']); // Grab, from the array, the 'alt'
$imageURL_BG = esc_url($imageArray_BG['url']); // Grab the full size version
One post object contain one post. I see now what you mean, relationship would be smarter code and query once to receive all meta. I didn’t think about each new DB queries here. But in this case I need to fetch one post per post object strictly even if it from the side doesn’t make sense.
Regarding the conditions it displays a different post object category based on which category the page have selected which is a select field on the page. Like if we would have 20 post objects fruits and 20 post object vegetables. Then the first post object in fruits would show apple while if the category was vegetables it would show carrot as the first post object field.
But with what you said I should maybe skip conditions here and make 10 different blocks as this would reduce the DB queries, as each block would then represent the conditions. That way I would limit the calls to one extent. Which maybe wouldn’t have been an issue with the relationship field as you explained using one call to fetch all posts in one query.
But looking at a whole page with other plugins DB calls such as WPML and other together with other page custom fields the amount of fields maybe is much it’s relative I guess, the number must be compared to each function what you try to do to determine if it’s much or not. But logged in I have just as an example SQL (233 queries|62.61 ms)
. It might still be ways to optimize the DB queries here even if I’m not going with the relationship fields, as one example as you suggested below regarding get_post_meta()
Is there an easy way to check if the queries is cached or not? I also use redis object cache. But I anyhow wouldn’t prefer to rely on cache it should be beneficial not a must.
This can be simulated by doing get_post_meta($post_object->ID); which results in the same thing, WP gets all of the meta values for the post in a single query and caches them.
Could you show me this in one of my examples above, I didn’t make it work. Where would you like to place it?
Thanks for the answer regarding if/elseif/else
and switch
conditions.
what name should it have?
Array
(
[ID] => 0
[key] => field_5fad1c053194c
[label] =>
[name] => acf[field_5fad1c053194c]
[prefix] => acf
[type] => group
[value] => Array
(
[field_5fad1f55299f4] =>
[field_5fad1c313194d] => 1
[field_5fad1c493194e] => Array
(
[0] => Array
(
[field_5fad1c733194f] => Emergenze
[field_5fad1d7e31954] => 1
[field_5fad643cea81d] => Array
(
[field_5f9c1fb8b4913] => Array
(
[field_5f9c211cb4914] => 6925
[field_5f9c27fab4915] => Scopri di più
)
)
[field_5fad1cde31950] => Lorem ipsum
[field_5fad1cf131951] => Prestiamo soccorso alle popolazioni vittime di emergenze umanitarie, attraverso la distribuzione di beni primari e la ricostruzione. Oltre l’emergenza, creiamo le condizioni perché l’aiuto si trasformi in un percorso di sviluppo e autonomia per le comunità locali.
[field_5fad1dea31955] => 7004
)
[1] => Array
(
[field_5fad1c733194f] => Sviluppo
[field_5fad1d7e31954] => 0
[field_5fad643cea81d] => Array
(
[field_5f9c1fb8b4913] => Array
(
[field_5f9c211cb4914] =>
[field_5f9c27fab4915] =>
)
)
[field_5fad1cde31950] => Test
[field_5fad1cf131951] => Prestiamo soccorso alle popolazioni vittime di emergenze umanitarie, attraverso la distribuzione di beni primari e la ricostruzione. Oltre l’emergenza, creiamo le condizioni perché l’aiuto si trasformi in un percorso di sviluppo e autonomia per le comunità locali. Prestiamo soccorso alle popolazioni vittime di emergenze umanitarie, attraverso la distribuzione di beni primari e la ricostruzione. Oltre l’emergenza, creiamo le condizioni perché l’aiuto si trasformi in un percorso di sviluppo e autonomia per le comunità locali.
[field_5fad1dea31955] => 7007
)
)
)
[menu_order] => 0
[instructions] =>
[required] => 0
[id] => acf-field_5fad1c053194c
[class] =>
[conditional_logic] => 0
[parent] => group_5fad1bae10663
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[layout] => block
[wpml_cf_preferences] => 0
[_name] => featured_blocks
[_valid] => 1
[sub_fields] => Array
(
[0] => Array
(
[ID] => 0
[key] => field_5fad1f55299f4
[label] => Informazioni
[name] =>
[prefix] => acf
[type] => message
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5fad1c053194c
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[wpml_cf_preferences] => 0
[message] => In evidenza mostra in alto alla pagina subito dopo la testata uno o più blocchi (con metodologia tab) contenenti titolo, descrizione, immagine ed eventuale link se reso visibile della pagina selezionata.
[new_lines] => wpautop
[esc_html] => 0
[_name] =>
[_valid] => 1
)
[1] => Array
(
[ID] => 0
[key] => field_5fad1c313194d
[label] => Attivo
[name] => is_active
[prefix] => acf
[type] => true_false
[value] =>
[menu_order] => 1
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5fad1c053194c
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[message] =>
[default_value] => 0
[ui] => 1
[ui_on_text] =>
[ui_off_text] =>
[wpml_cf_preferences] => 0
[_name] => is_active
[_valid] => 1
)
[2] => Array
(
[ID] => 0
[key] => field_5fad1c493194e
[label] => Blocchi in evidenza
[name] => items
[prefix] => acf
[type] => repeater
[value] =>
[menu_order] => 2
[instructions] =>
[required] => 1
[id] =>
[class] =>
[conditional_logic] => Array
(
[0] => Array
(
[0] => Array
(
[field] => field_5fad1c313194d
[operator] => ==
[value] => 1
)
)
)
[parent] => field_5fad1c053194c
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[wpml_cf_preferences] => 0
[collapsed] => field_5fad1c733194f
[min] => 1
[max] => 0
[layout] => block
[button_label] => Aggiungi blocco
[_name] => items
[_valid] => 1
[sub_fields] => Array
(
[0] => Array
(
[ID] => 0
[key] => field_5fad1c733194f
[label] => Etichetta
[name] => label
[prefix] => acf
[type] => text
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 1
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5fad1c493194e
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[wpml_cf_preferences] => 2
[default_value] =>
[placeholder] =>
[prepend] =>
[append] =>
[maxlength] =>
[_name] => label
[_valid] => 1
)
[1] => Array
(
[ID] => 0
[key] => field_5fad1d7e31954
[label] => Link a pagina
[name] => cta_is_active
[prefix] => acf
[type] => true_false
[value] =>
[menu_order] => 1
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5fad1c493194e
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[wpml_cf_preferences] => 0
[message] =>
[default_value] => 0
[ui] => 1
[ui_on_text] =>
[ui_off_text] =>
[_name] => cta_is_active
[_valid] => 1
)
[2] => Array
(
[ID] => 0
[key] => field_5fad643cea81d
[label] =>
[name] => link
[prefix] => acf
[type] => clone
[value] =>
[menu_order] => 2
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => Array
(
[0] => Array
(
[0] => Array
(
[field] => field_5fad1d7e31954
[operator] => ==
[value] => 1
)
)
)
[parent] => field_5fad1c493194e
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[clone] => Array
(
[0] => group_5f9c1faa3f1a8
)
[display] => group
[layout] => block
[prefix_label] => 1
[prefix_name] => 0
[wpml_cf_preferences] => 0
[_name] => link
[_valid] => 1
[sub_fields] => Array
(
[0] => Array
(
[ID] => 0
[key] => field_5f9c1fb8b4913
[label] =>
[name] => link_to_page
[prefix] => acf
[type] => group
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => group_5f9c1faa3f1a8
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[wpml_cf_preferences] => 1
[layout] => block
[_name] => link_to_page
[_valid] => 1
[sub_fields] => Array
(
[0] => Array
(
[ID] => 0
[key] => field_5f9c211cb4914
[label] => Collegamento
[name] => post
[prefix] => acf
[type] => post_object
[value] =>
[menu_order] => 0
[instructions] => Seleziona il collegamento dall'elenco.
[required] => 1
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5f9c1fb8b4913
[wrapper] => Array
(
[width] => 50
[class] =>
[id] =>
)
[wpml_cf_preferences] => 1
[post_type] => Array
(
[0] => page
)
[taxonomy] =>
[allow_null] => 0
[multiple] => 0
[return_format] => object
[ui] => 1
[_name] => post
[_valid] => 1
)
[1] => Array
(
[ID] => 0
[key] => field_5f9c27fab4915
[label] => Etichetta pulsante
[name] => label
[prefix] => acf
[type] => text
[value] =>
[menu_order] => 1
[instructions] => Se il campo non viene valorizzato, viene preso automaticamente il titolo.
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5f9c1fb8b4913
[wrapper] => Array
(
[width] => 50
[class] =>
[id] =>
)
[wpml_cf_preferences] => 2
[default_value] =>
[placeholder] =>
[prepend] =>
[append] =>
[maxlength] =>
[_name] => label
[_valid] => 1
)
)
[_clone] => field_5fad643cea81d
[__key] => field_5f9c1fb8b4913
[__name] => link_to_page
[__label] =>
)
)
)
[3] => Array
(
[ID] => 0
[key] => field_5fad1cde31950
[label] => Titolo
[name] => title
[prefix] => acf
[type] => text
[value] =>
[menu_order] => 3
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5fad1c493194e
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[wpml_cf_preferences] => 2
[default_value] =>
[placeholder] =>
[prepend] =>
[append] =>
[maxlength] =>
[_name] => title
[_valid] => 1
)
[4] => Array
(
[ID] => 0
[key] => field_5fad1cf131951
[label] => Descrizione
[name] => description
[prefix] => acf
[type] => textarea
[value] =>
[menu_order] => 4
[instructions] =>
[required] => 1
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5fad1c493194e
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[default_value] =>
[placeholder] =>
[maxlength] =>
[rows] => 3
[new_lines] =>
[wpml_cf_preferences] => 2
[_name] => description
[_valid] => 1
)
[5] => Array
(
[ID] => 0
[key] => field_5fad1dea31955
[label] => Immagine
[name] => image_desktop
[prefix] => acf
[type] => image_aspect_ratio_crop
[value] =>
[menu_order] => 5
[instructions] =>
[required] => 1
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5fad1c493194e
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[wpml_cf_preferences] => 0
[crop_type] => aspect_ratio
[aspect_ratio_width] => 567
[aspect_ratio_height] => 401
[return_format] => array
[preview_size] => full
[library] => all
[min_width] =>
[min_height] =>
[min_size] =>
[max_width] =>
[max_height] =>
[max_size] =>
[mime_types] =>
[_name] => image_desktop
[_valid] => 1
)
)
)
)
[_prepare] => 1
)
Hi,
with the filter you provided me the answer is this below.
The group is simple and is not contained in other groups or a clone.
Array
(
[ID] => 0
[key] => field_5f1b04a650dbe
[label] =>
[name] => acf[field_5f1b04a650dbe]
[prefix] => acf
[type] => group
[value] => Array
(
[field_5fad6bdaa2903] => 1
[field_5f1b0571deda4] =>
)
[menu_order] => 0
[instructions] =>
[required] => 0
[id] => acf-field_5f1b04a650dbe
[class] =>
[conditional_logic] => 0
[parent] => group_5f1b04a64d28d
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[layout] => block
[_name] => link_scope_pages
[_valid] => 1
[sub_fields] => Array
(
[0] => Array
(
[ID] => 0
[key] => field_5fad6bdaa2903
[label] => Automatico
[name] => is_automatic
[prefix] => acf
[type] => true_false
[value] =>
[menu_order] => 0
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => field_5f1b04a650dbe
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[message] =>
[default_value] => 1
[ui] => 1
[ui_on_text] =>
[ui_off_text] =>
[wpml_cf_preferences] => 0
[_name] => is_automatic
[_valid] => 1
)
[1] => Array
(
[ID] => 0
[key] => field_5f1b0571deda4
[label] => Seleziona pagine ambito
[name] => items
[prefix] => acf
[type] => relationship
[value] =>
[menu_order] => 1
[instructions] =>
[required] => 1
[id] =>
[class] =>
[conditional_logic] => Array
(
[0] => Array
(
[0] => Array
(
[field] => field_5fad6bdaa2903
[operator] => !=
[value] => 1
)
)
)
[parent] => field_5f1b04a650dbe
[wrapper] => Array
(
[width] =>
[class] =>
[id] =>
)
[post_type] => Array
(
[0] => page
)
[taxonomy] =>
[filters] => Array
(
[0] => search
)
[elements] => Array
(
[0] => featured_image
)
[min] =>
[max] =>
[return_format] => object
[wpml_cf_preferences] => 0
[_name] => items
[_valid] => 1
)
)
[_prepare] => 1
)
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.