• Hello,

    I am new to php. How can I add a custom field within the media library which would allow me to assign an external url to images? I would then want to tell wordpress to get that link within the php.

    Is that possible?

    Thanks!
    Lily

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It should be possible, though I haven’t done this myself. The media library is javascript/jQuery based, so you would use jQuery to insert the field. Then you need to find a hook in the PHP process that inserts the image in the post in order to grab the custom field content and do something with it.

    However, are you sure the functionality you want does not already exist? I’m not sure exactly what you’re doing, but if you are trying to reference an external image in a post, you can do so by picking “Insert from URL” Or if you want the image to link to an external URL when clicked, use “Link to Custom URL”

Viewing 1 replies (of 1 total)
  • The topic ‘creating an external link field to images in media library’ is closed to new replies.