Selected Image on Edit Post Page
-
Let’s say we have inserted an image into a post. In the Visual tab you will see the image, if you click it to select it, the option and delete ‘buttons’ will appear on it in the top left corner. Clicking the edit button brings up a pop-up dialog that allows for editing various bits of information including the Link URL. If you switch the editor to HTML tab you will see that it contains an <img tag wrapped with a <a tag.
I have created a plug-in that allows me to select a piece of text in the Visual editor, click a button in a custom meta box and voila that text becomes a link. I would like to make it so that selecting an Image in the Visual tab, then clicking the same button in the meta box will change the Link URL for that image. The problem is when the image is selected I cannot seem to retrieve any information about it from TinyMCE. The value used to retrieve the text is empty.
So basically the question is how can you get/set information about the selected image.
Apologies if this is in the wrong section. It seemed the most appropriate.
- The topic ‘Selected Image on Edit Post Page’ is closed to new replies.