function custom_time_based_welcome_message() {
// Set timezone to Jakarta
date_default_timezone_set('Asia/Jakarta');
// Get current hour in 24-hour format
$hour = date('G');
// Get current user's display name
$current_user = wp_get_current_user();
$user_name = $current_user->display_name;
// Determine the appropriate greeting based on the hour
if ($hour >= 5 && $hour = 12 && $hour = 18 && $hour <= 21) {
$message = "Selamat Sore";
} else {
$message = "Selamat Malam";
}
// Display the greeting message with the user's name
echo '' . $message . ' ' . $user_name . ' 😊 Selamat bekerja di dashboard WordPress Anda.
';
}
add_action('admin_notices', 'custom_time_based_welcome_message');