HTML tags are allowed. Add multiple lines for random display.
';
}
function advanced_preloader_text_display_mode_field()
{
$options = get_option('advanced_preloader_general');
$mode = isset($options['text_display_mode']) ? $options['text_display_mode'] : 'full';
echo '';
// Image output
if (($preloader_type === 'image' || $preloader_type === 'both') && !empty($general['image'])) {
$image_id = $general['image'];
$image_url = !empty($image_id) ? wp_get_attachment_url($image_id) : '';
$output .= '

';
}
// Text output
if (($preloader_type === 'text' || $preloader_type === 'both') && !empty($general['text'])) {
$text_content = wp_kses_post($general['text']);
$display_mode = in_array($general['text_display_mode'] ?? 'full', ['full', 'random']) ? $general['text_display_mode'] : 'full';
if ($display_mode === 'random') {
$lines = array_filter(array_map('trim', explode("\n", $text_content)));
$text_content = !empty($lines) ? $lines[array_rand($lines)] : __('Loading...', 'advanced-preloader');
}
$output .= '
' . $text_content . '
';
}
$output .= '
';
echo wp_kses_post($output);
}
add_action('wp_footer', 'advanced_preloader_display');