Title: remove esc_url in widget function ($instance[&#039;link&#039;])
Last modified: August 21, 2016

---

# remove esc_url in widget function ($instance['link'])

 *  Resolved [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-esc_url-in-widget-function-instancelink/)
 * Hi,
 * I would like to see the esc_url function removed in the widget function on line
   91 (image_widget.php).
 * `$instance['link'] = apply_filters( 'image_widget_image_link', $instance['link'],
   $args, $instance );`
 * This function makes it imposible for me to add shortcodes in the url.
 * My shortcode: [url]/page
 * If this is possible in an other way, please let me know!
 * Thank you
 * [http://wordpress.org/plugins/image-widget/](http://wordpress.org/plugins/image-widget/)

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

 *  [Peter Chester](https://wordpress.org/support/users/peterchester/)
 * (@peterchester)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-esc_url-in-widget-function-instancelink/#post-4328783)
 * Because the security of the masses is more important than the flexibility for
   a few, I’m not planning on removing that code. However… I think you could write
   a function that bypasses it on your site if you want.
 * the whole thing is wrapped in a filter ‘image_widget_image_link’. That means 
   that you can write a function to hook that filter that does whatever you want.
   In fact, you can even do away with the [url] shortcode all together by detecting
   if the link starts with ‘http’ and if it doesn’t then assume it’s a local link
   that needs your url in it.
 * BTW, this also normally works fine with local links. you can just put in ‘/page’
   and it will work on most people’s sites.
 *  Thread Starter [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-esc_url-in-widget-function-instancelink/#post-4328883)
 * Thanks for your reply.
 * I understand and no problem. Your solution at the bottom worked (why did I never
   thought of that -.-) so it’s no problem anymore.

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

The topic ‘remove esc_url in widget function ($instance['link'])’ is closed to new
replies.

 * ![](https://ps.w.org/image-widget/assets/icon-256x256.png?rev=2489603)
 * [Image Widget](https://wordpress.org/plugins/image-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/image-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/image-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/image-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/image-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/image-widget/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/remove-esc_url-in-widget-function-instancelink/#post-4328883)
 * Status: resolved