Support » Plugin: Enhanced Media Library » Apply taxonomy on import based on post category

  • Hi Nadia,

    Great plugin you’ve made, kudos for that πŸ˜‰
    Now I’m using User Submitted Posts plugin which also upload images for the post. How can I set taxonomy on those images based on category which user selects during post creation?
    To be precise: how to use $usp_post_category so it will be copied to image taxonomy?
    $term_taxonomy_ids = wp_set_object_terms( $image_ID, $usp_post_category, '?category?' );?
    Thanks in advance,
    aeM

    https://wordpress.org/plugins/enhanced-media-library/

Viewing 1 replies (of 1 total)
  • Plugin Author webbistro

    (@webbistro)

    Hi aeM,

    Sorry, I have missed your request πŸ™

    Thank you for your kind words about the plugin!

    If you mean post category, then

    $term_taxonomy_ids = wp_set_object_terms( $image_ID, $usp_post_category, 'category' );

    Please make sure that $image_ID is a correct attachment ID, and $usp_post_category is a slug or an ID of a category.

    -Nadia

Viewing 1 replies (of 1 total)
  • The topic ‘Apply taxonomy on import based on post category’ is closed to new replies.