繁体   English   中英

在变量中添加wp_insert_post()重要吗?

[英]Is it important to add wp_insert_post() in a varrible?

我是否总是必须将wp_insert_post()放在像这样的变量中

$new_post = wp_insert_post($args);

还是只是偏爱?

不,您不需要。 wp_insert_post()返回成功创建的帖子的ID( 失败则返回0 )。 如果您以后想要将新创建的帖子用于其他内容,这将很方便。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM