This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,15 @@ In that way is more easy to do script on it in bash or other languages
3939# How to use the script:
4040# cat list.txt | xargs -n1 remove-page-by-url.sh
4141
42- out=` wp get-by-url $1 --skip-plugins --skip-themes`
43- if [[ ! -z $out ]]; then
44- command=` cut -d'|' -f1 <<< $out`
45- id=` cut -d'|' -f2 <<< $out`
46- taxonomy=` cut -d'|' -f3 <<< $out`
47- if [[ $taxonomy == 'post' ]]; then
48- wp $command delete $id --skip-plugins --skip-themes
42+ out=$( wp get-by-url "$1" --skip-plugins --skip-themes)
43+ if [[ -n $out ]]; then
44+ command=$( cut -d'|' -f1 <<< " $out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
45+ id=$( cut -d'|' -f2 <<< " $out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
46+ taxonomy=$( cut -d'|' -f3 <<< " $out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
47+ if [[ " $taxonomy" == 'post' ]]; then
48+ wp " $command" delete " $id" --skip-plugins --skip-themes
4949 else
50- wp $command delete $taxonomy $id --skip-plugins --skip-themes
50+ wp " $command" delete " $taxonomy" " $id" --skip-plugins --skip-themes
5151 fi
5252fi
5353```
You can’t perform that action at this time.
0 commit comments