-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp_helpers.sh
31 lines (27 loc) · 1.71 KB
/
wp_helpers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
alias composer="php /root/composer.phar"
export PATH="$HOME/.composer/vendor/bin:$PATH"
# Function to create posts
create_posts() {
# Set the default number of posts to 10 if no argument is provided
local num_posts=${1:-5}
# Loop to create the specified number of posts
for ((index=1; index<=num_posts; index++)); do
echo $index
# Use WP-CLI to create a post with the title "foobar$index" and content "lorem ipsum"
wp post create --post_type=post --post_status=publish --post_title="foobar_$index" --post_content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse hendrerit mauris ut rutrum accumsan. Vivamus mollis ipsum eget ipsum auctor, eu efficitur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse hendrerit mauris ut rutrum accumsan. Vivamus mollis ipsum eget ipsum auctor, eu efficitur"
done
wp post create --post_type=post --post_status=publish --post_title="Login with admin:admin" --post_content="http://localhost:1337/wp-admin"
}
readd_admin(){
wp user create admin [email protected] --role=administrator --user_pass=admin
}
dbinit(){
wp --allow-root core install [email protected] --url=localhost:1337 --title="Just a Boring Blog" --admin_user=admin --admin_password=admin
# readd_admin
wp user create subscriber [email protected] --role=subscriber --user_pass=subscriber
wp user create contributor [email protected] --role=contributor --user_pass=contributor
wp user create editor [email protected] --role=editor --user_pass=editor
wp user list
wp theme install twentytwentyfour # if you deleted it like me
wp theme activate twentytwentyfour # if you deleted it like me
}