Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit a8a037e

Browse files
authored
getting work the example script
1 parent 3f8a402 commit a8a037e

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

readme.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +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`
43-
command=`cut -d'|' -f1 <<< $out`
44-
id=`cut -d'|' -f2 <<< $out`
45-
taxonomy=`cut -d'|' -f3 <<< $out`
46-
if [ $taxonomy == 'post' ];
47-
wp $command delete $id
48-
else
49-
wp $command delete $taxonomy $id
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
49+
else
50+
wp $command delete $taxonomy $id --skip-plugins --skip-themes
51+
fi
5052
fi
5153
```

0 commit comments

Comments
 (0)