Support » Plugin: FileBird - WordPress Media Library Folders » Is there any way to assign “File Bird” cateogry dynamically to the image?

  • Resolved mayanksdudakiya

    (@mayanksdudakiya)


    Hey,

    I would like to thank you for this awesome plugin. I am wondering, Is there any way to assign “File Bird” categories to the image programmatically?

    I am saving a custom post type data with image and I would like to upload that image into the particular folder of “File Bird” via programs.

    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ninja Team

    (@ninjateam)

    Hi there,

    To upload images to a FileBird folder, you can use the dropdown like the second picture here https://ninjateam.gitbook.io/filebird/features-of-the-plugin

    Let me know if this helps.

    Best regards,
    Kelly

    mayanksdudakiya

    (@mayanksdudakiya)

    Hey,

    Thanks for the quick reply,
    Sorry, But I know how to assign categories via GUI. But I would like to assign the categories while uploading images programmatically. Like the below function.

    $attachment_id = media_handle_upload( 'image', $postId);

    Thank you in advance.

    Plugin Author Ninja Team

    (@ninjateam)

    Hi there,

    You can see here

    wp_set_object_terms(
                $postId,
                $folderId,
                "nt_wmc_folder",
                false
            );

    $folderId in FileBird is a term_id (can get in wp_term in database) and “nt_wmc_folder” is a constant of FileBird taxonomy.
    I hope this helps.

    Best regards,
    Kelly

    mayanksdudakiya

    (@mayanksdudakiya)

    Hey, Thank you for your quick reply.

    Yes, It will be helpful.

    Thank you 🙂

    Plugin Author Ninja Team

    (@ninjateam)

    It’s good to hear that, could you take some seconds to write for FileBird a nice review?
    Thank you so much.

    Kelly

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.