Browse Source

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

pull/187/head
Ned Zimmerman 6 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( $atts = shortcode_atts(
[ [
'link' => '#', 'link' => '#',
'url' => false,
'text' => 'Call To Action', 'text' => 'Call To Action',
], ],
$atts, $atts,
'aldine_call_to_action' 'aldine_call_to_action'
); );
// Fallback for shortcodes using the old url attribute
if ( $atts['link'] === '#' && $atts['url'] ) {
$atts['link'] = $atts['url'];
}
return sprintf( return sprintf(
'<a class="call-to-action" href="%1$s" title="%2$s">%2$s</a>', '<a class="call-to-action" href="%1$s" title="%2$s">%2$s</a>',
$atts['link'], $atts['link'],

Loading…
Cancel
Save