WordPress.org

Ready to get started?Download WordPress

Forums

Adding 'rel' attribute to <a> tag in iimage editor (7 posts)

  1. stelabouras
    Member
    Posted 8 years ago #

    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!

  2. 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.

  3. stelabouras
    Member
    Posted 8 years ago #

    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?

  4. 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?

  5. stelabouras
    Member
    Posted 8 years ago #

    :(

    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?

  6. stelabouras
    Member
    Posted 8 years ago #

    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

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

    WYSIWYG editors are crap anyway. :P

Topic Closed

This topic has been closed to new replies.

About this Topic