From 2dc23803f571d7f7f51122d75267bcec12b90862 Mon Sep 17 00:00:00 2001 From: Mitkevich Anton Date: Fri, 8 Jun 2018 12:56:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0?= =?UTF-8?q?=20=D0=BA=D0=B0=D1=80=D1=82=D1=8B=20=D0=B8=D0=B7=20acf=20repeat?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acf-yandex-map.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;