Could you send me a screenshot of your ACF field and the code you use to call eae_encode_emails()?
Thread Starter
Prebyter
(@prebytergmailcom)
First field is a repeater field:
http://cl.ly/image/1C2V3u2O070c
Second field inside the first, too:
http://cl.ly/image/1h3Y0j2H2u0s
Relevant options of the second field (select, with multiple selection true):
http://cl.ly/image/3w0l321G2B26
My EAE calls in the function.php:
add_filter(‘acf/load_value’, ‘eae_encode_emails’);
add_filter( ‘walker_nav_menu_start_el’, ‘eae_encode_emails’ );
Thanks Till
Can you try using the acf/format_value filter instead of acf/load_value and see if everything works as exspected?
Thread Starter
Prebyter
(@prebytergmailcom)
Yes, it works. But if i remove the “if(is_string($string))”-construct it fails the same way as before.
Can you send me an export of your ACF configuration?
Thread Starter
Prebyter
(@prebytergmailcom)
http://f.cl.ly/items/2U1G0h031a002j2M0E2D/advanced-custom-field-export.xml
// Error message appears on the edit-post.php page (not on the ACF plugin page)
Hey!
One permanent solution would be this:
add_filter( 'acf/format_value', function( $value ) {
if ( is_string( $value ) ) {
$value = eae_encode_emails( $value );
}
return $value;
} );
Another idea would be to target the individual fields using one of these filters:
acf/format_value/type={$field_type}
acf/format_value/name={$field_name}
acf/format_value/key={$field_key}
I’ll add the is_string() check to the next version as well.
had the same problem and Till’s code fixed it – thx a lot!