Skip to content

Instantly share code, notes, and snippets.

@mslepko
Created February 27, 2026 22:54
Show Gist options
  • Select an option

  • Save mslepko/03d50b3bb030297874b268f2952d9d9d to your computer and use it in GitHub Desktop.

Select an option

Save mslepko/03d50b3bb030297874b268f2952d9d9d to your computer and use it in GitHub Desktop.
Fix for Fatal error Scheme_Typography Scheme_Color
#!/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