#Listing all pages
wp post list
#Listing all pages with type page
wp post list --post_type='page'
#Updates an option value for example the value of Simple page is id = 2
wp option update page_on_front 2
#Update the page as front page by default.
wp option update show_on_front page
3条答案
按热度按时间bwleehnv1#
字符串
2wnc66cl2#
您可以使用wp options update命令,参见documentation
字符串
syqv5f0l3#
首先在系统中安装WP-CLI。这里是关于如何安装wp-cli的参考
https://wp-cli.org/
https://www.sitepoint.com/wp-cli/的
https://make.wordpress.org/cli/handbook/installing/的
成功安装wpcli后使用wp option命令
字符串