Skip to content

Instantly share code, notes, and snippets.

@BenBroide
Last active April 17, 2019 23:47
Show Gist options
  • Save BenBroide/39602755b1b4e7d36429734428e6eb71 to your computer and use it in GitHub Desktop.
Save BenBroide/39602755b1b4e7d36429734428e6eb71 to your computer and use it in GitHub Desktop.
#!/bin/bash
function create_terms( ){
array=("$@")
for tax; do true; done
for term in "${array[@]}"
do
wp term create $tax "$term" --allow-root
done
}
listing_categories=(
"Studio"
"1 bedroom"
"2 bedrooms"
"3 bedrooms"
"4 bedrooms"
)
create_terms "${listing_categories[@]}" listing_category
areas=(
"Downtown"
"Midtown left"
"Upper East"
"Upper West"
"Lower East Site"
"Noho Right"
)
create_terms "${areas[@]}" area
amenities=(
"Doorman"
"Rooftop"
"Elevator"
"Pool"
"Wifi"
"TV"
)
create_terms "${amenities[@]}" amenities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment