diff --git a/acf-yandex-map.php b/acf-yandex-map.php index efa4058..f776b86 100644 --- a/acf-yandex-map.php +++ b/acf-yandex-map.php @@ -41,7 +41,11 @@ function the_yandex_map( $selector, $post_id = false, $data = null ) { $post_id = function_exists( 'acf_get_valid_post_id' ) ? acf_get_valid_post_id( $post_id ) : $post_id; - $value = ( $data !== null ) ? $data : get_field( $selector, $post_id, false ); + if( !empty(get_field( $selector, $post_id, false ))) { + $value = ( $data !== null ) ? $data : get_field( $selector, $post_id, false ); + } else { + $value = ( $data !== null ) ? $data : get_sub_field( $selector, $post_id, false ); + } if ( ! $value ) { return;