• Resolved seamuso

    (@seamuso)


    using twenty-eleven theme (child) + WP 3.3.2 This is probably pretty easy to do, I just don’t know where to make the change. I have the prettyphoto plugin installed so I can have any image overlays. I’ve already taken care of getting the script to add to all pages and posts, but I need to modify the URL that is generated when the “insert into post” button is clicked.

    <a href="http://images.test.com/screenshots/whatever.png" rel="prettyPhoto">

    I need rel=”prettyPhoto” added by default to all of my image links when they are uploaded. What file or files need to be modified to do this?

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can use the image_send_to_editor filter, but this is probably easier to do via jQuery in your <head> tag somewhere:

    jQuery(document).ready(function($){
        $('a[href$="jpg"], a[href$="png"], a[href$="jpeg"]').attr('rel', 'prettyPhoto');
    });

    Haven’t tested it, but if you add this before the prettyPhoto js is included, it should work.

    Thread Starter seamuso

    (@seamuso)

    That did it, thanks!

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

The topic ‘Modify generated media URL?’ is closed to new replies.