Browse Source

Add fallback for CTA shortcode using old attribute (fix #184) (#185)

pull/187/head
Ned Zimmerman 5 years ago committed by Dac Chartrand
parent
commit
95605f2390
  1. 6
      inc/shortcodes/namespace.php

6
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(
'<a class="call-to-action" href="%1$s" title="%2$s">%2$s</a>',
$atts['link'],

Loading…
Cancel
Save