WordPress.org

Ready to get started?Download WordPress

Forums

Easy Watermark
Watermarking on frontend uploads (9 posts)

  1. Hassan
    Member
    Posted 1 year ago #

    I have a frontend form created with the CRED plugin that creates posts and sets featured image from a file upload field. The images uploaded through this form do not get auto-watermarked even though I enabled the option of auto-watermarking.

    Backend uploads still work fine. Does this plugin support frontend uploads?

    http://wordpress.org/plugins/easy-watermark/

  2. szaleq
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Hassan,

    Sorry for this long time of silence. Easy Watermark does not distinguish front or backend upload, it is just plugged into some hook which is used in wp_insert_attachment() function. If the CRED plugin does the upload in a "wordpress way" using wordpress functions, it should work. But maybe it has some other functions... I'll try to check what's wrong.

  3. Hassan
    Member
    Posted 1 year ago #

    I've asked the CRED devs and they said their plugin does use the "wordpress way". They said they're using the wp_handle_upload function. Here's the exact code snippet that's responsible for this.

  4. szaleq
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, I have looked into the code, and created an account on CRED testing sites. Here is what I found: the plugin uploads the file 'wordpress way' but does not insert the file as a wordpress 'attachment' (files uploaded on frontend are not listed in wordpress media library) so the wp_insert_attachment function is not called and Easy Watermark doesn't know the file was uploaded. There is no solution for this at the moment since it needs a lot of additional coding to handle this. Maybe it's a suggestion to CRED developers, they should insert wordpress attachment also, instead of just uploading the file...?

    Regards

  5. Hassan
    Member
    Posted 1 year ago #

    Hmmm... I don't know about this, I actually see the uploaded images under my Media Library. Not sure why these images still don't get watermarked.

  6. Hassan
    Member
    Posted 1 year ago #

    Oops, spoke too soon. You're correct; CRED does not create attachments. I'll talk with them about this. Thanks for the help!

  7. Hassan
    Member
    Posted 11 months ago #

    Ok, I feel a bit stupid here. The uploaded images actually DO appear in the Media Library in the backend (I'm not sure how I missed seeing them :S), which means CRED does create attachments. I also just confirmed this with CRED devs as well.

    Any idea why watermarks are still not applying? Maybe CRED is creating the attachments after your code executes? Just a thought..

  8. szaleq
    Member
    Plugin Author

    Posted 11 months ago #

    Hi,

    The code which does the watermarking action is actually plugged into the wordpress function which creates the attachment (wp_generate_attachment_metadata), so it must be executed if the function is called.

    I don't have a time for a deeper search currently, but if I have some, I'll try to figure it out. Maybe you could send me (email) the code of CRED you are using? (Just for testing purpose, since I can't see everything on their free trial site)

  9. Hassan
    Member
    Posted 11 months ago #

    Hmmm... I'm not really sure now why it isn't applying either.

    I have this shortcode in my CRED form builder page:
    [cred_field field="_featured_image"]
    ..which renders the file upload field on the frontend and creates the featured image of the post from it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.