Created
February 27, 2026 22:54
-
-
Save mslepko/03d50b3bb030297874b268f2952d9d9d to your computer and use it in GitHub Desktop.
Fix for Fatal error Scheme_Typography Scheme_Color
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Define the directory to search | |
| DIRECTORY="/wp-content/plugins/" | |
| # Define the replacements as an associative array | |
| declare -A REPLACEMENTS=( | |
| ["Scheme_Typography::TYPOGRAPHY_1"]="1" | |
| ["Scheme_Typography::TYPOGRAPHY_2"]="2" | |
| ["Scheme_Typography::TYPOGRAPHY_3"]="3" | |
| ["Scheme_Typography::TYPOGRAPHY_4"]="4" | |
| ["Scheme_Color::get_type()"]="'color'"/ | |
| ["Scheme_Color::COLOR_1"]="1" | |
| ["Scheme_Color::COLOR_2"]="2" | |
| ["Scheme_Color::COLOR_3"]="3" | |
| ["Scheme_Color::COLOR_4"]="4" | |
| ) | |
| # Find all PHP files in the directory and subdirectories | |
| find "$DIRECTORY" -type f -name "*.php" | while read -r file; do | |
| # Loop through the replacements and apply them | |
| for key in "${!REPLACEMENTS[@]}"; do | |
| sed -i "s/${key}/${REPLACEMENTS[$key]}/g" "$file" | |
| done | |
| echo "Processed: $file" | |
| done | |
| echo "All replacements completed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment