如何使用 php 脚本将标签添加到 Drupal 7 中的新节点


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

我正在尝试从php脚本在Drupal 7中添加新文章。如何将新标签添加到Drupal,然后将这些新标签添加到创建的节点?

在wordpress中,事情很容易,我们所需要的只是使用内置函数:

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

Drupal 7 中有类似的功能吗?

在Drupal世界中,你可以利用node_save()功能。这里的工作示例 https://www.drupal.org/node/1388922。感谢您的反馈