This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

How to get Media Field Value to display in frontend

10 years ago · Last reply by Andrew Misplon 10 years ago

Hi there,

I have used form_options to create form for custom widget in page builder using so widget bundle. Now I am able to get all the other field data like text, textarea, etc.

But I am not getting media URL that I have uploaded in MEDIA form field.

Can you please give me code to get my image that I have uploaded from media File upload?

Awaiting to hear from you.

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

2
  1. Andrew Misplon Staff 10 years, 9 months ago

    Hi Makwana

    Thanks for reaching out.

    I had a quick chat with Braam, one of our developers. He let me know that the media field returns and ID, it doesn’t return a URL. You’ll need to use a function like:

    wp_get_attachment_image_src

    https://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src

    to resolve the URL.

    Hope that helps a little. We unfortunately don’t have an example on GitHub, we just checked.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread