[英]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.