• Resolved glennwelker

    (@glennwelker)


    I am currently working on a plugin that I would like to have store the location to an image in a database table. Ideally I would like to be able to use functionality already in WordPress to select the image from the gallery and then push its path to a custom form in the edit post area.

    Can anyone point me in the right direction of how I would use the image tools in WordPress to accomplish this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Let me try to understand your question. You want to make a plugin that stores an image location in a database table, and allows you to click on the image from the gallery and have it take you to a custom form in the edit post area? I suppose I could help. I’m not really an expert when it comes to creating a WordPress plugin, but I do Web programming. It sounds like the plugin maker (a WYSIWYG tool) does not allow you to create an image hyperlink. That’s okay. Just go to the code editor and put to the left of <img src=”your-image” height=”your image height” width=”your-image-width”> and to the right.

    Excuse me. I didn’t know this forum would process the hyperlink. Anyway, here’s the code to use: (add < before the a href): a href=”http://www.your-blog.com/”<img src=”your-image-url” height=”your-image-height” width=”your-image-width”>

    Thread Starter glennwelker

    (@glennwelker)

    Thanks. I was really looking for a simple way to tie a single image to a post. I didn’t want the image actually in the body of the post because I want to use it in different sections of my template.

    In the end, WordPress already does this. It creates an entry in the posts table for each image that you add while editing a post. I can get to the image later by querying the database an looking for an attachment with a parent of the postid.

    Thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select from gallery’ is closed to new replies.