Skip to content

Instantly share code, notes, and snippets.

@axxe16
Created September 11, 2020 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axxe16/8d2dc5093517756e8682387b4ca62583 to your computer and use it in GitHub Desktop.
Save axxe16/8d2dc5093517756e8682387b4ca62583 to your computer and use it in GitHub Desktop.
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