diff --git a/fields/acf-button-v5.php b/fields/acf-button-v5.php index b0dca27..03c5f31 100755 --- a/fields/acf-button-v5.php +++ b/fields/acf-button-v5.php @@ -825,11 +825,10 @@ public function format_value( $value, $post_id, $field ) { $rel = ''; $class = 'button'; // get url - if url exists use it, if not use the page id to get permalink. - if ( 'custom' === $value['type'] ) { + if ( 'custom' === $field['default_type'] ) { $url = $value['url']; } else { - $type = $value['type']; - $url = get_permalink( $value[ $type ] ); + $url = get_permalink( $field['value']['post'] ); } // get target.