'', 'item_name' => '', 'amount' => '', 'currency' => 'USD', 'quantity' => '1', 'custom' => '', 'return_url' => '', 'cancel_url' => '', 'sandbox' => 'no', 'type' => 'buynow', // buynow, donate, subscribe 'style' => 'classic', // classic, elegant, custom 'button_image' => '', 'shipping' => '0.00', 'css_class' => '', ], $atts); // Basic validations $atts['sandbox'] = in_array($atts['sandbox'], ['yes', 'no']) ? $atts['sandbox'] : 'no'; $atts['type'] = in_array($atts['type'], ['buynow', 'donate', 'subscribe']) ? $atts['type'] : 'buynow'; $atts['style'] = in_array($atts['style'], ['classic', 'elegant', 'custom']) ? $atts['style'] : 'classic'; return $atts; } function aa_spaypal_get_button_image($type, $style) { $base = 'https://www.paypalobjects.com/en_US/i/btn/'; $styles = [ 'buynow' => [ 'classic' => $base . 'btn_buynowCC_LG.gif', 'elegant' => $base . 'btn_buynow_SM.gif', ], 'donate' => [ 'classic' => $base . 'btn_donateCC_LG.gif', 'elegant' => $base . 'btn_donate_SM.gif', ], 'subscribe' => [ 'classic' => $base . 'btn_subscribeCC_LG.gif', 'elegant' => $base . 'btn_subscribe_SM.gif', ], ]; return $styles[$type][$style] ?? $styles['buynow']['classic']; }