Last active
January 4, 2018 22:55
-
-
Save hawkidoki/5eeda97f2b3c280094f8c2286ba9e992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hwk_acf_get_group_by_field($field, $post_id = null){ | |
if(!$post_id) | |
$post_id = get_the_ID(); | |
if(!$post_id) | |
$post_id = get_queried_object_id(); | |
if( ($field = get_field_object($field, $post_id)) && isset($field['parent']) && ($group = acf_get_field_group($field['parent'])) ) | |
return $group; | |
return; | |
} | |
$group = hwk_acf_get_group_by_field('champs_texte'); | |
$group['hwk_image']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment