/>

ID, '_guest_author', true); $author_name = !empty($guest_author_name) ? $guest_author_name : get_the_author(); $custom_texts = get_option('wp_multi_custom_texts', ''); $second_custom_texts = get_option('wp_multi_second_custom_text', ''); $custom_texts_array = array_filter(array_map('trim', explode("\n", $custom_texts))); $second_custom_texts_array = array_filter(array_map('trim', explode("\n", $second_custom_texts))); $selected_custom_text = get_post_meta($post->ID, '_custom_text_choice', true); $selected_second_custom_text = get_post_meta($post->ID, '_second_custom_text_choice', true); if (empty($custom_texts_array) && empty($second_custom_texts_array)) { return $content; } $output = '
'; $output .= '

' . __('Autor:', 'wp-multi') . ' ' . esc_html($author_name); if ($selected_second_custom_text !== '' && isset($second_custom_texts_array[$selected_second_custom_text])) { $output .= ' | ' . esc_html($second_custom_texts_array[$selected_second_custom_text]); } $output .= '

'; if ($selected_custom_text !== '' && isset($custom_texts_array[$selected_custom_text])) { $output .= '

' . esc_html($custom_texts_array[$selected_custom_text]) . '

'; } $output .= '
'; return $content . $output; } return $content; } add_filter('the_content', 'wp_multi_custom_text_display'); // Funktion zum Hinzufügen der Meta-Box für beide Custom Texts function wp_multi_add_custom_text_fields($post) { $custom_texts = get_option('wp_multi_custom_texts'); $custom_texts_array = array_filter(array_map('trim', explode("\n", $custom_texts))); $second_custom_text = get_option('wp_multi_second_custom_text'); $second_custom_text_array = array_filter(array_map('trim', explode("\n", $second_custom_text))); $selected_custom_text = get_post_meta($post->ID, '_custom_text_choice', true); $selected_second_custom_text = get_post_meta($post->ID, '_second_custom_text_choice', true); wp_nonce_field('wp_multi_custom_text_choice_nonce', 'wp_multi_custom_text_choice_nonce_field'); ?>