Add color codes and validation to wordpress-cron-manager.sh sub-menu

- Add ${CYAN}...${NC} color codes to status check sub-menu options
- Add ${RED}0)${NC} color code to cancel option
- Implement input validation with retry loop for check_choice (0-2)
- Add visual separator line before sub-menu prompt

This completes menu uniformity standardization for this script.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
cschantz
2026-02-17 19:06:38 -05:00
parent 5992cd452c
commit 48613ad5f5
@@ -589,13 +589,26 @@ case "$choice" in
# Check status # Check status
echo "" echo ""
echo "Check wp-cron status for:" echo "Check wp-cron status for:"
echo " 1) Specific domain" echo -e " ${CYAN}1)${NC} Specific domain"
echo " 2) Specific user" echo -e " ${CYAN}2)${NC} Specific user"
echo " 0) Cancel" echo -e " ${RED}0)${NC} Cancel"
echo "" echo ""
echo -n "Select [1]: " echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
read -r check_choice
check_choice="${check_choice:-1}" # Validate check_choice input
while true; do
echo -n "Select [1]: "
read -r check_choice
check_choice="${check_choice:-1}"
if ! [[ "$check_choice" =~ ^[0-2]$ ]]; then
echo ""
print_error "Invalid choice. Please enter 0, 1, or 2"
echo ""
continue
fi
break
done
if [ "$check_choice" = "0" ]; then if [ "$check_choice" = "0" ]; then
echo "Operation cancelled." echo "Operation cancelled."