Created
October 2, 2023 16:08
-
-
Save twentyfortysix/ad79523b60700312b01c8f659630d56c to your computer and use it in GitHub Desktop.
post2post_wp-cli_connections.sh
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
# bin/bash | |
for LOCATION in $(wp post list --post_type=locations --posts_per_page=-1 --format=ids); do | |
for PARTNER in $(wp post list --post_type=partners --connected_type=page2page --connected_items=$LOCATION --nopaging=true --posts_per_page=100 --format=ids); do | |
wp post delete $PARTNER --force | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment