'; settings_fields('sharemypost_settings_group'); echo '

' . esc_html__('Inline Content', 'sharemypost') . '

' . esc_html__('Configure how share buttons appear inside your post content.', 'sharemypost') . '

'; self::render_inline_network_selection_settings($settings,'sharemypost_settings'); echo '
'; // --- CARD 1: Displays Rules --- echo '

' . esc_html__('Display Rules', 'sharemypost') . '

' . esc_html__('Position', 'sharemypost') . '
' . esc_html__('Display on Post Types', 'sharemypost') . '
'; $post_types = get_post_types(['public' => true], 'objects'); unset($post_types['attachment']); $ordered_types = []; $core_slugs = ['post', 'page']; foreach($core_slugs as $slug){ if(isset($post_types[$slug])){ $ordered_types[$slug] = $post_types[$slug]; unset($post_types[$slug]); } } foreach($post_types as $pt => $obj){ $ordered_types[$pt] = $obj; } foreach ( $ordered_types as $pt => $obj ) { $label = isset( $obj->labels->singular_name ) ? $obj->labels->singular_name : ucfirst( $pt ); $is_checked = in_array( $pt, (array) $settings['inline_post_types'], true ); echo ''; } echo '
' . esc_html__('Show on Mobile', 'sharemypost') . '
'; // Style Card do_action("sharemypost_inline_style_settings",$settings,'sharemypost_settings'); self::render_extras_settings( $settings, 'sharemypost_settings', 'inline'); echo '
'; self::render_inline_ai_network_settings($settings, 'sharemypost_settings'); echo '
'; } static function render_extras_settings($settings, $opt, $type = 'inline') { $show_labels = isset($settings['inline_show_labels'])? $settings['inline_show_labels']: (isset($settings['show_labels']) ? $settings['show_labels'] : 'icon_only'); $color_type = isset($settings['inline_button_color_type'])? $settings['inline_button_color_type']: (isset($settings['button_color_type']) ? $settings['button_color_type'] : 'custom'); $button_color = isset($settings['inline_button_color'])? $settings['inline_button_color']: (isset($settings['button_color']) ? $settings['button_color'] : '#1f75e1'); echo '

' . esc_html__('Inline Button Appearance', 'sharemypost') . '

' . esc_html__('Show Labels', 'sharemypost') . '
' . esc_html__('Button Colors', 'sharemypost') . '
' . esc_html__('Select Custom Color', 'sharemypost') . '
'; do_action('sharemypost_inline_content_settings', $settings, $opt); } static function render_inline_network_selection_settings($settings, $opt){ $enabled_list = (array) $settings['inline_enabled_networks']; $order = Helpers::normalize_network_order($settings['inline_network_order']); $inline_sortable = apply_filters('sharemypost_network_grid_sortable', true) ? ' sharemypost-core-sortable' : ''; $inline_note = apply_filters('sharemypost_network_grid_note', esc_html__('Choose which networks should appear in share bars. Drag cards to reorder.', 'sharemypost')); echo '

' . esc_html__('Inline Networks', 'sharemypost') . '

' . esc_html($inline_note) . '

'; static $allowed_svg = null; if(null === $allowed_svg){ $allowed_svg = [ 'svg' => [ 'viewbox' => true, 'viewBox' => true, 'xmlns' => true, 'fill' => true, 'style' => true, ], 'path' => [ 'd' => true, 'fill' => true, 'style' => true, ], ]; } foreach(Helpers::get_networks_ordered('inline') as $network => $data){ $is_checked = in_array($network, $enabled_list, true); $active_class = $is_checked ? 'is-active' : ''; echo ''; } echo '
'; } static function render_inline_ai_network_settings($settings, $opt) { do_action('sharemypost_inline_ai_network_settings', $settings, $opt); } static function configuration_settings(){ do_action('sharemypost_configuration_settings'); } static function click_to_tweet_settings(){ do_action('sharemypost_click_to_x_settings'); } }