upskill-event-manager/scripts/assign-page-templates.sh
bengizmo 81190ec4a0 Fix legacy URL redirects being intercepted by access control
- Added is_legacy_url() check in access control to allow redirects to happen first
- Legacy URLs like /hvac-dashboard/ now properly redirect to /trainer/dashboard/
- Prevents authentication check from blocking legacy URL redirects

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 19:45:43 -03:00

34 lines
No EOL
839 B
Bash
Executable file

#!/bin/bash
echo "=== Assigning Page Templates ==="
ssh roodev@146.190.76.204 << 'ENDSSH'
cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html
# Function to set page template
set_page_template() {
local page_id="$1"
local template="$2"
echo "Setting template '$template' for page ID $page_id..."
wp post meta update "$page_id" "_wp_page_template" "$template"
}
# Master Dashboard - ID 5347
set_page_template 5347 "page-master-dashboard.php"
# Trainer Registration - ID 5334
set_page_template 5334 "page-trainer-registration.php"
# Trainer Dashboard - ID 5333
set_page_template 5333 "page-trainer-dashboard.php"
# Trainer Profile - ID 5335
set_page_template 5335 "page-trainer-profile.php"
# Clear cache
wp cache flush
wp breeze purge --cache=all
echo -e "\n✅ Templates assigned and cache cleared"
ENDSSH