Created
August 3, 2018 16:52
-
-
Save mgratch/e0cc0a07cddc6f42434f6a6e07516ea6 to your computer and use it in GitHub Desktop.
Declare an array of shortcodes and replacement values, iterate over each and search and replace all instances in the DB.
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
declare -A array=([x-large]='h1' [large]='h2' [medium]='h3' [small]='h4' [x-small]='h5' [xx-smal]='h6'); | |
for key in ${!array[@]};do | |
printf "Start [$key] Search\n"; | |
wp search-replace "[$key]" "<${array[$key]} class='headline headline--slab headline-get-page-color'>" --all-tables --precise --recurse-objects --format=count; | |
printf "Start [/$key] Search\n"; | |
wp search-replace "[/$key]" "</${array[$key]}>" --all-tables --precise --recurse-objects --format=count; | |
printf "Next Search\n"; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment