Support » Plugins » Adding ‘rel’ attribute to <a> tag in iimage editor

  • Hello everyone! I just wanted to add the rel=’lightbox’ in every thumbnail that is generated from the iimage editor, so i can use the lightbox image viewer in my blog. I edited the iimage-browser.php adding the rel=’lightbox’ in the appropriate values, but when i click ‘insert into post’ button this attribute is lost! Additionaly if i edit the html of the post and put it manually from there, it is not appearing as well! I figured that WordPress has a sort of validation system that removes every other attribute from the ‘a’ tag and leaves only the ‘href’ and ‘title’ …How can i edit this thing in order to accept the rel attribute?

    Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hmm, I thought WP ignores high level users and let’s them post whatever they want. Guess not…

    kses.php in your wp-includes folder.

    Thnx! I have found the file and i put

    ‘a’ => array(
    ‘rel’ => array(),
    ‘href’ => array(),
    ‘title’ => array()

    but it doesn’t seems to work! :S Is there somewhere else that i have to make changes inside this file?

    Hmm, now that I think of it, “embed” isn’t listed there but I use it all the time on my blog…

    I just went and tested on my local WordPress test blog and I can add rel="lightbox" perfectly find to any image tag I wish.

    Do you have the WYSIWYG editor enabled? If so, disable it.

    If you already have it off, then that’s really weird. What version of WordPress are you running?


    I use WordPress 1.5.2 with WYSI-Wordpress plugin that adds more functionality to the post categoy ( WYSIWYG editor )…I cant understand why the changes that i make to kses.php dont affect this…Is there a possibility this plugin to override those edits?

    I think i have found the error but the tweaks i have to make are way too many..This plugin uses tiny_MCE which firstly doesnt allow the rel attr and secondly its very hard to insert it…Like Rewriting parts of some functions.. :S

    Disable all WYSIWYG editors and try with just the old-style editor.

    WYSIWYG editors are crap anyway. 😛

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Adding ‘rel’ attribute to <a> tag in iimage editor’ is closed to new replies.