Title: Need help with simple plugin
Last modified: August 18, 2016

---

# Need help with simple plugin

 *  [robotdan](https://wordpress.org/support/users/robotdan/)
 * (@robotdan)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/need-help-with-simple-plugin/)
 * I’d like to implement this css/javascript photo displaying script on my site:
 * [http://www.huddletogether.com/projects/lightbox/](http://www.huddletogether.com/projects/lightbox/)
 * All that I need to do is add rel=”lightbox” into the link tag of the code that’s
   produced when you use the new File Upload box to add an image to the post, where
   you specify it to use the thumbnail and having it linked to an image.
 * i.e. Instead of
 * `<a href="http://www..../image.jpg" title="image">...`
 * it would show
 * `<a href="http://www..../image.jpg" title="image" rel="lightbox">...`
 * While it would be easy enough to hack the code, could somebody tell me how to
   write a plugin which adds this code in?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [vaamyob](https://wordpress.org/support/users/vaamyob/)
 * (@vaamyob)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/need-help-with-simple-plugin/#post-314866)
 * You can create a plugin that adds a button to the edit post page that generates
   the html:
 * `<a ... rel="lightbox"></a>`
 * You can view my hide/show plugin for a simple example of adding a button to insert
   html into the content.
 * The relevant parts are:
 * `add_filter('admin_footer', 'hide_show_button');`
    and `function hide_show_button()`
   and `function add_edit_button($caption, $js_onclick, $title = '')`
 * [http://www.xyooj.com/blog/plink/technical/26/hideshow/](http://www.xyooj.com/blog/plink/technical/26/hideshow/)
 *  Thread Starter [robotdan](https://wordpress.org/support/users/robotdan/)
 * (@robotdan)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/need-help-with-simple-plugin/#post-314869)
 * Thanks for the idea, but my website’s authors are using the File Upload box in
   WordPress 2.0… they aren’t too hot with editing HTML. I’ve not written a plugin
   before but I think a filter function should do it… but how do I get it to add
   the code to only the link tags pointing to images?
 *  [the13th](https://wordpress.org/support/users/the13th/)
 * (@the13th)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/need-help-with-simple-plugin/#post-315121)
 * *cough*
    [http://www.m3nt0r.de/blog/lightbox-wordpress-plugin/](http://www.m3nt0r.de/blog/lightbox-wordpress-plugin/)*
   cough*

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Need help with simple plugin’ is closed to new replies.

## Tags

 * [photo](https://wordpress.org/support/topic-tag/photo/)

 * 3 replies
 * 3 participants
 * Last reply from: [the13th](https://wordpress.org/support/users/the13th/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/need-help-with-simple-plugin/#post-315121)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
