Skip to content

Instantly share code, notes, and snippets.

@axxe16

axxe16/function.php

Created Sep 11, 2020
Embed
What would you like to do?
Recuperare campi ACF su immagini e allegati con WPML attivo #wpml #acf #attachment #immagini
<?php
if( ICL_LANGUAGE_CODE == 'it' ) {
$link = get_field('link_ita', apply_filters( 'wpml_object_id', $image['ID'], 'attachment', TRUE, 'it' ));
} elseif( ICL_LANGUAGE_CODE == 'en' ) {
$link = get_field('link_en', apply_filters( 'wpml_object_id', $image['ID'], 'attachment', TRUE, 'en' ));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.