'', 'style' => '', 'show_title' => 'true', 'title_text' => '', 'title_style' => '', 'show_icons' => '', 'icon_style' => '' ), $atts, 'ayudawp_share_buttons'); $options = get_option('ayudawp_aiss_options'); // Override options with shortcode attributes $shortcode_options = $options; // Handle buttons parameter if (!empty($atts['buttons'])) { $enabled_buttons = array_map('trim', explode(',', $atts['buttons'])); } else { $enabled_buttons = isset($options['enabled_buttons']) ? $options['enabled_buttons'] : array(); } if (empty($enabled_buttons) || !is_array($enabled_buttons)) { return ''; } // Handle style parameter if (!empty($atts['style'])) { $shortcode_options['button_colors'] = esc_attr($atts['style']); } // Handle title parameters if (!empty($atts['title_text'])) { $shortcode_options['title_text'] = $atts['title_text']; } if (!empty($atts['title_style'])) { $shortcode_options['title_style'] = $atts['title_style']; } // Handle show_title parameter if ($atts['show_title'] === 'false') { $shortcode_options['title_text'] = ''; } // Handle icons parameters if (!empty($atts['show_icons'])) { $shortcode_options['show_icons'] = ($atts['show_icons'] === 'true'); } if (!empty($atts['icon_style'])) { $shortcode_options['icon_style'] = $atts['icon_style']; } $current_url = get_permalink(); $current_title = get_the_title(); $html = AyudaWP_AISS_Buttons::ayudawp_generate_buttons_html( $enabled_buttons, $shortcode_options, $current_url, $current_title ); // Add shortcode-specific class $html = str_replace('class="ayudawp-share-buttons', 'class="ayudawp-share-buttons shortcode-buttons', $html); return $html; } }