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

Commit c6b022a

Browse files
committed
fix(media): bash example updated
1 parent c7fba0c commit c6b022a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function codeat_get_by_url( $args ){
2727
$url = preg_replace( "/^(.+)-\d+?x\d+?(\.\w+)$/i","$1$2", $url );
2828
$media = attachment_url_to_postid( $url );
2929
if ( $media !== 0 ) {
30-
WP_CLI::log( 'media | ' . $media . ' | attachment' );
30+
WP_CLI::log( 'post | ' . $media . ' | attachment' );
3131
return;
3232
}
3333
}

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ out=$(wp get-by-url "$1" --skip-plugins --skip-themes)
4545
if [[ -n $out ]]; then
4646
command=$(cut -d'|' -f1 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
4747
id=$(cut -d'|' -f2 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
48-
taxonomy=$(cut -d'|' -f3 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
49-
if [[ "$taxonomy" == 'post' ]]; then
48+
what=$(cut -d'|' -f3 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
49+
if [[ "$what" == 'post' ]]; then
5050
wp "$command" delete "$id" --skip-plugins --skip-themes
5151
else
52-
wp "$command" delete "$taxonomy" "$id" --skip-plugins --skip-themes
52+
wp "$command" delete "$what" "$id" --skip-plugins --skip-themes
5353
fi
5454
fi
5555
```

0 commit comments

Comments
 (0)