admin管理员组文章数量:1425972
How create post using WP-CLI at time of network site create. I am creating network sites using WP-CLI.
I have tried:
wp post create --post_type=page --post_title='ABC' --post_status=publish --network
But it creates post on main site. But, I want to create that post on network site which was created that time.
Thanks in advance.
Any reference will be helpful.
How create post using WP-CLI at time of network site create. I am creating network sites using WP-CLI.
I have tried:
wp post create --post_type=page --post_title='ABC' --post_status=publish --network
But it creates post on main site. But, I want to create that post on network site which was created that time.
Thanks in advance.
Any reference will be helpful.
2 Answers
Reset to default 3You can try the --url
argument to target a given site in your network:
wp post create \
--post_type=page \
--post_title='ABC' \
--post_status=publish \
--url=http://example.tld/somesite/
where you can view available site urls with
wp site list
Global attribute --url=<url>
is required to post in a networked site.
wp post create --url=subdomain.exampledomain [OPTIONS]
Ref : https://developer.wordpress/cli/commands/post/create/
本文标签: multisiteHow to create post in WP network using WPCLI
版权声明:本文标题:multisite - How to create post in WP network using WP-CLI 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745422109a2657945.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论