| @@ -48,16 +48,15 @@ | ||
| 48 | 48 | do_action('ws_plugin__s2member_before_sc_s_badge', get_defined_vars()); |
| 49 | 49 | unset($__refs, $__v); |
| 50 | 50 | |
| 51 | 51 | $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array)$attr); |
| 52 | - | |
| 53 | - //251225 Validate attr value. | |
| 52 | + $attr = shortcode_atts(array('v' => '1'), $attr); // One attribute. | |
| 53 | + | |
| 54 | + //260920.1758 Validate the badge version after shortcode defaults are applied, avoiding an undefined-index notice when v is omitted. | |
| 54 | 55 | $attr['v'] = (string)(int)$attr['v']; |
| 55 | 56 | if (!in_array($attr['v'], array('1','2','3'), true)) { |
| 56 | 57 | $attr['v'] = '1'; |
| 57 | 58 | } |
| 58 | - | |
| 59 | - $attr = shortcode_atts(array('v' => '1'), $attr); // One attribute. | |
| 60 | 59 | $code = c_ws_plugin__s2member_utilities::s_badge_gen($attr['v'], FALSE, FALSE); |
| 61 | 60 | |
| 62 | 61 | return apply_filters('ws_plugin__s2member_sc_s_badge', $code, get_defined_vars()); |
| 63 | 62 | } |