简体   繁体   English

如何使用PHP脚本在Drupal 7中将标签添加到新节点?

[英]How add tags to new node in Drupal 7 using php script?

I'm trying to add new articles in Drupal 7 from php script. 我正在尝试从php脚本在Drupal 7中添加新文章。 How to add new tags to Drupal and than add this new tags to created node? 如何将新标签添加到Drupal,然后将此新标签添加到创建的节点?

In wordpress thing is easy, all we need is using buildin function: 在WordPress中,事情很简单,我们需要的是使用内置函数:

wp_set_post_terms( $post_id, $terms, $taxonomy, $append ) 

Is there a similar function in Drupal 7? Drupal 7中有类似的功能吗?

In the Drupal world, you can take advantage of the node_save() fuction. 在Drupal世界中,您可以利用node_save()功能。 Working example here https://www.drupal.org/node/1388922 . 这里的工作示例https://www.drupal.org/node/1388922 Thanks for your feedback 感谢您的反馈意见

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

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