• Hi,
    I have an image in my wordpress media gallery needs to be updated daily/weekly. I want a user to upload a new image onto old one in my media gallery with a front-end form. Is this possible?

    I found replace image plugins but all are working in wordpress media library. I’m looking for a front-end solution. Any help really appreciated!

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • With a bit of code everything is possible. Well I guess if you already have a form, then you could create search filter for existing images with auto suggest and image preview and when image is selected option for replacement would appear like a button, when you click it, modal comes up where visitor can drag and drop replacement image.

    As well questions, to clarify your expectations. What exactly do you want? Do you want a plugin that would do that for you? Or you want code examples that would implement that kind of stuff into your form or would create front end form?

    If you want plugin, then I’d suggest you’d go for ACF. Which allows to create forms for frontend. You can define them in backend and output via code or shortcode to frontend. But I warn you that ACF uses custom fields, which become slow as postmeta table size increases.

    • This reply was modified 6 years, 3 months ago by juslintek. Reason: Added more specific text
    Thread Starter ercan3

    (@ercan3)

    Thanks juslintek! I’ll check the site.

    Just to clarify what I want is:
    – there is an image in my media library (in a fixed folder) This is a weekly program.
    – I want a user to replace this specific image file with an updated image file every week (a new weekly program)
    – I don’t want user to access admin page/media library so I need a frontend solution.
    – Form or page doesn’t matter. User can select new image file (with the same name and dimensions) and click replace/update to upload this image onto old one in WP folder.

    Hope it is clear now.

    • This reply was modified 6 years, 3 months ago by ercan3.

    Well then you just need upload input with form. So if specific image is mapped to specific user, then just fetch that image path in a callback of ajax/sync post call on submit of that file input field form. In form you specify action, on which you’ll be listening using wp_ajax_your_action for $_FILES global variable.

    Basically just do as done here:
    https://codex.www.ads-software.com/Plugin_API/Action_Reference/admin_post_(action)
    or following:
    https://codex.www.ads-software.com/AJAX_in_Plugins

    Depends on how you want it to be handled.

    But still I haven’t figure out if you want someone to provide code with solution, or you need some direction where you can read to create it yourself.

    • This reply was modified 6 years, 3 months ago by juslintek.

    @ercan3 Did you find a solution already? I’m having the exact same wish. A user wants to be able to update an image weekly without needing to login in the backend.

    Thread Starter ercan3

    (@ercan3)

    Hi @ryankn unfortunately I could not find a solution. Still looking for.

    Hi @ercan3 for the time being I hosted the image from a shared dropbox folder, where the user can replace the image in dropbox and it will show on the front-end.
    Maybe this can be a temporary solution for you too, til we find a better one.

    Thread Starter ercan3

    (@ercan3)

    Hi @ryankn thanks a lot for your suggestion. It worked well for me. Actually this can be a permanent solution for us ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Front-end solution to replace an image’ is closed to new replies.