' . esc_html__('Settings', 'ai-share-summarize') . ''; array_unshift($links, $settings_link); return $links; } /** * Show activation notice */ public function ayudawp_activation_notice() { if (get_current_screen()->id !== 'plugins' || get_option('ayudawp_aiss_activation_notice_dismissed')) { return; } if (get_transient('ayudawp_aiss_just_activated')) { ?>
ayudawp_register_settings_fields(); } /** * Register settings fields */ private function ayudawp_register_settings_fields() { $fields = array( 'default_prompt' => esc_html__('AIs Default Prompt', 'ai-share-summarize'), 'enabled_buttons' => esc_html__('Enabled buttons', 'ai-share-summarize'), 'display_locations' => esc_html__('Where to display the buttons', 'ai-share-summarize'), 'auto_insert_position' => esc_html__('Automatic insertion position', 'ai-share-summarize'), 'auto_insert_content_types' => esc_html__('Automatic insertion by content type', 'ai-share-summarize'), 'twitter_handle' => esc_html__('X handle to mention', 'ai-share-summarize'), 'custom_text' => esc_html__('Custom text in prompts', 'ai-share-summarize'), 'title_text' => esc_html__('Title text before buttons', 'ai-share-summarize'), 'title_style' => esc_html__('Title style', 'ai-share-summarize'), 'button_order' => esc_html__('Buttons order', 'ai-share-summarize'), 'button_colors' => esc_html__('Button style', 'ai-share-summarize'), 'show_icons' => esc_html__('Show icons', 'ai-share-summarize'), 'icon_style' => esc_html__('Icons only style', 'ai-share-summarize'), 'seo_button_type' => esc_html__('Button HTML Type', 'ai-share-summarize'), 'delete_data_on_uninstall' => esc_html__('Data cleanup', 'ai-share-summarize') ); foreach ($fields as $field_id => $field_title) { add_settings_field( $field_id, $field_title, array($this, 'ayudawp_' . $field_id . '_callback'), 'ayudawp_aiss_settings', 'ayudawp_aiss_main' ); } } /** * Admin page content */ public function ayudawp_admin_page() { ?> [ayudawp_share_buttons]
[ayudawp_share_buttons buttons="twitter,claude,chatgpt"]
[ayudawp_share_buttons show_icons="true" style="brand"]
[ayudawp_share_buttons style="icons-only"]
' . esc_html__('Select which buttons to display on the frontend.', 'ai-share-summarize') . '
'; } public function ayudawp_display_locations_callback() { $options = get_option('ayudawp_aiss_options'); $locations = isset($options['display_locations']) ? $options['display_locations'] : array(); if (!is_array($locations)) { $locations = array(); } $available_locations = array( 'posts' => esc_html__('Posts', 'ai-share-summarize'), 'pages' => esc_html__('Pages', 'ai-share-summarize'), 'archives' => esc_html__('Archives', 'ai-share-summarize'), 'home' => esc_html__('Home', 'ai-share-summarize'), 'cpt' => esc_html__('Custom Post Types', 'ai-share-summarize') ); echo '' . esc_html__('Select in which types of content to display the buttons:', 'ai-share-summarize') . '
'; foreach ($available_locations as $key => $label) { $checked = in_array($key, $locations) ? 'checked="checked"' : ''; echo ''; } } public function ayudawp_auto_insert_position_callback() { $options = get_option('ayudawp_aiss_options'); $position = isset($options['auto_insert_position']) ? $options['auto_insert_position'] : 'after_content'; $positions = array( 'disabled' => esc_html__('Disabled (shortcode only mode)', 'ai-share-summarize'), 'before_content' => esc_html__('Before the content', 'ai-share-summarize'), 'after_content' => esc_html__('After the content', 'ai-share-summarize'), 'both' => esc_html__('Before and after the content', 'ai-share-summarize') ); echo '' . esc_html__('Select where to automatically insert the buttons:', 'ai-share-summarize') . '
'; foreach ($positions as $key => $label) { $checked = ($position === $key) ? 'checked="checked"' : ''; echo ''; } echo '' . esc_html__('Note:', 'ai-share-summarize') . ' ' . esc_html__('When disabled, it will only be displayed using the shortcode [ayudawp_share_buttons].', 'ai-share-summarize') . '
'; } public function ayudawp_auto_insert_content_types_callback() { $options = get_option('ayudawp_aiss_options'); $content_types = isset($options['auto_insert_content_types']) ? $options['auto_insert_content_types'] : array(); if (!is_array($content_types)) { $content_types = array(); } $post_types = get_post_types(array('public' => true), 'objects'); echo '' . esc_html__('Select the types of content in which to automatically insert the buttons:', 'ai-share-summarize') . '
'; echo '' . esc_html__('It will only be applied to singular content (not to lists or files).', 'ai-share-summarize') . '
'; } public function ayudawp_twitter_handle_callback() { $options = get_option('ayudawp_aiss_options'); $value = isset($options['twitter_handle']) ? $options['twitter_handle'] : ''; ?> esc_html__('Heading 3 (h3)', 'ai-share-summarize'), 'h4' => esc_html__('Heading 4 (h4)', 'ai-share-summarize'), 'h5' => esc_html__('Heading 5 (h5)', 'ai-share-summarize'), 'h6' => esc_html__('Heading 6 (h6)', 'ai-share-summarize'), 'span' => esc_html__('Span (plain text)', 'ai-share-summarize') ); echo '' . esc_html__('Select the HTML element for the title:', 'ai-share-summarize') . '
'; foreach ($styles as $key => $label) { $checked = ($style === $key) ? 'checked="checked"' : ''; echo ''; } } public function ayudawp_button_order_callback() { $options = get_option('ayudawp_aiss_options'); $order = isset($options['button_order']) ? $options['button_order'] : 'ayudawp_ai_first'; $orders = array( 'ayudawp_social_first' => esc_html__('Social media first', 'ai-share-summarize'), 'ayudawp_ai_first' => esc_html__('AIs first', 'ai-share-summarize'), 'ayudawp_mixed' => esc_html__('Mixed', 'ai-share-summarize') ); foreach ($orders as $key => $label) { $checked = ($order === $key) ? 'checked="checked"' : ''; echo ''; } } public function ayudawp_button_colors_callback() { $options = get_option('ayudawp_aiss_options'); $style = isset($options['button_colors']) ? $options['button_colors'] : 'brand'; $styles = array( 'default' => esc_html__('Default colors', 'ai-share-summarize'), 'brand' => esc_html__('Brand colors', 'ai-share-summarize'), 'minimal' => esc_html__('Minimal', 'ai-share-summarize'), 'dark' => esc_html__('For dark backgrounds', 'ai-share-summarize'), 'icons-only' => esc_html__('Icons only', 'ai-share-summarize') ); foreach ($styles as $key => $label) { $checked = ($style === $key) ? 'checked="checked"' : ''; echo ''; } echo '' . esc_html__('Select the visual style for the buttons. Icons only style shows only icons without text.', 'ai-share-summarize') . '
'; } public function ayudawp_show_icons_callback() { $options = get_option('ayudawp_aiss_options'); $show_icons = isset($options['show_icons']) ? $options['show_icons'] : false; ?> esc_html__('Square corners', 'ai-share-summarize'), 'circular' => esc_html__('Circular', 'ai-share-summarize') ); echo '' . esc_html__('Select the corner style for icons-only buttons:', 'ai-share-summarize') . '
'; foreach ($styles as $key => $label) { $checked = ($icon_style === $key) ? 'checked="checked"' : ''; echo ''; } echo '' . esc_html__('This setting only affects the "Icons only" button style.', 'ai-share-summarize') . '
'; } public function ayudawp_seo_button_type_callback() { $options = get_option('ayudawp_aiss_options'); $seo_type = isset($options['seo_button_type']) ? $options['seo_button_type'] : 'link'; ?>
+
+
+
+
-
+
+
-
-
-