From 34d4168347797a383a5bcb9f29a72c856d1a8c9d Mon Sep 17 00:00:00 2001 From: jonasskafte Date: Sat, 13 Apr 2019 23:00:51 +0100 Subject: [PATCH] Update acf-button-v5.php Ref. https://wordpress.org/support/topic/custom-post-url-wrong-heres-a-fix/ --- fields/acf-button-v5.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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.