From 95605f239066810313c1caae9213dd1fbc7b7cc3 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Fri, 31 May 2019 11:11:22 -0300 Subject: [PATCH] Add fallback for CTA shortcode using old attribute (fix #184) (#185) --- inc/shortcodes/namespace.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/shortcodes/namespace.php b/inc/shortcodes/namespace.php index 4aa1dc3..490a543 100644 --- a/inc/shortcodes/namespace.php +++ b/inc/shortcodes/namespace.php @@ -44,12 +44,18 @@ function call_to_action( $atts ) { $atts = shortcode_atts( [ 'link' => '#', + 'url' => false, 'text' => 'Call To Action', ], $atts, 'aldine_call_to_action' ); + // Fallback for shortcodes using the old url attribute + if ( $atts['link'] === '#' && $atts['url'] ) { + $atts['link'] = $atts['url']; + } + return sprintf( '%2$s', $atts['link'],