aw2_set_taxonomy

This shortcode is used to set terms to a post. aw2_set_taxonomy shortcode is basically a wrapper to function wp_set_post_terms, so it can only be used with native post types like post, page.

attributes:

  • post_id:
    It is ID of the post whose taxonomy you want to update.
  • taxonomy:
    Slug of taxonomy whose terms we want to update, possible values for example: ‘category’, ‘post_tag’, ‘taxonomy slug’
  • terms:
    List of term IDs. Can be an array or a comma separated string. For hierarchical taxonomies use Id’s
  • terms_slugs:
    List of term slugs. Can be an array or a comma separated string. For non-hierarchical taxonomies you can use terms_slugs.

    You should either use terms or terms_slugs and not both. If you specify both, terms_slugs will be used.
  • append:
    If true, terms will be appended to the post. If false, terms will replace existing terms.

    By default, append is false

Examples: