• Hi,

    Let me first thank you for the useful plugin you developed.

    However, I find that Additional Fields option is under-developped (or it’s me not knowing how to use it right). Let me explain the use I intended for it. I use your plugin in posts so that users can upload documents related to the post. I than intended to list in the post all the files related to it by using another plugin called “Listed Related Attachments”. In the latter, there is a possiblitiy to list ‘caption’ or ‘description’ of the attachment besides the files name. My idea was to give the user the opportunity to add the caption (or the description) at the moment of uploading by using the Additional Fields.
    Can you please let me know if this is doable, or suggest me a way of doing this.
    Thanks in advance,

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

    (@nickboss)

    Hi, you can configure the additional fields very easily using the visual editor of the plugin. Do you need assistance with this?

    However how the other plugin lists the attachments? It lists the documents that are attached to the specific page?

    Regards

    Nickolas

    Thread Starter kikara

    (@kikara)

    Hi,
    Thanks for replying.
    I naturally did check your visual editor, and even tough it has some interesting options, noting there suits my need.
    Let me try to explain again. Once the file is uploaded by the user, I can go to the media library, and there I see the user’s text input on the right pane with something like “your message” preceding the users text. My question is if there is a way to put the user’s text input (from additional fields) into the ‘caption’ or ‘description’ field? I can for example manually enter some text into those fields when I edit the media file in the library, and the other plugin can than display that data together with the uploaded file name. And yes, the other plugin lists all the files attached to the specific page or post.

    Thanks again for your help,

    Plugin Author nickboss

    (@nickboss)

    Well putting the user’s text input inside the caption or description requires modification of the plugin’s code. A more proper way was to create new custom fields for the Media item, which as you said are shown in the right pane.

    What I would expect is the other plugin to display these custom fields, instead of only grabbing caption or description. Have you checked that?

    Nickolas

    Thread Starter kikara

    (@kikara)

    Ok I will try to ask the authors of the other plugin if they can provide the way to grab the data in the custom field your plugin creates. Would you be so kind to indicate how to target the field created by your plugin, in case they ask?
    Thank you for your time, and thanks again for developing this plugin,
    Cheers,

    Plugin Author nickboss

    (@nickboss)

    Hi, yes of course, the following function takes the attachment ID of an image as parameter and returns the custom userdata fields as an array.

    
    function wfu_read_media_metadata($attachment_id) {
    	$data = array();
    	$attachment_data = wp_get_attachment_metadata($attachment_id);
    	if ( isset($attachment_data["WFU User Data"]) ) $data = $attachment_data["WFU User Data"];
    	return $data;
    }
    

    The other plugin developer can use this function to retrieve them.

    Regards

    Nickolas

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add Caption to the uploaded file in Additional Fields’ is closed to new replies.