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

Commit

Permalink
fix(media): bash example updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Jun 18, 2021
1 parent c7fba0c commit c6b022a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion command.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function codeat_get_by_url( $args ){
$url = preg_replace( "/^(.+)-\d+?x\d+?(\.\w+)$/i","$1$2", $url );
$media = attachment_url_to_postid( $url );
if ( $media !== 0 ) {
WP_CLI::log( 'media | ' . $media . ' | attachment' );
WP_CLI::log( 'post | ' . $media . ' | attachment' );
return;
}
}
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ out=$(wp get-by-url "$1" --skip-plugins --skip-themes)
if [[ -n $out ]]; then
command=$(cut -d'|' -f1 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
id=$(cut -d'|' -f2 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
taxonomy=$(cut -d'|' -f3 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
if [[ "$taxonomy" == 'post' ]]; then
what=$(cut -d'|' -f3 <<< "$out" | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')
if [[ "$what" == 'post' ]]; then
wp "$command" delete "$id" --skip-plugins --skip-themes
else
wp "$command" delete "$taxonomy" "$id" --skip-plugins --skip-themes
wp "$command" delete "$what" "$id" --skip-plugins --skip-themes
fi
fi
```

0 comments on commit c6b022a

Please sign in to comment.