Title: Widget
Last modified: August 22, 2016

---

# Widget

 *  Resolved [testerderesta](https://wordpress.org/support/users/testerderesta/)
 * (@testerderesta)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/widget-87/)
 * Hi there,
 * Great plugin! I appreciate this isn’t exactly your problem, but I am trying to
   use this in conjunction with another plugin in a widget (WP Float to be specific),
   but that plugin doesn’t work with shortcodes. Do you know any way I’d be able
   to get round this?
 * Thanks in advance!
 * [https://wordpress.org/plugins/mpress-image-refresh/](https://wordpress.org/plugins/mpress-image-refresh/)

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

 *  [Micah Wood](https://wordpress.org/support/users/woodent/)
 * (@woodent)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/widget-87/#post-5350543)
 * [@testerderesta](https://wordpress.org/support/users/testerderesta/),
 * Yes, the issue is that the WP Float author hasn’t utilized the `do_shortcode()`
   function when outputting the content. Thankfully, WordPress gives us a hook where
   we can add that in without having to make any changes to the WP Float plugin.
 * Here is the code:
 *     ```
       add_filter( 'widget_display_callback', 'process_shortcodes_in_wp_float', 10, 3 );
       function process_shortcodes_in_wp_float( $instance, $this, $args ) {
       	if ( is_a( $this, 'WP_Float' ) ) {
       		$instance['html'] = do_shortcode( $instance['html'] );
       	}
       	return $instance;
       }
       ```
   
 * Just drop that in your active theme’s functions.php file and it should start 
   working for you. I’ve tested it, so I know it works.
 *  Thread Starter [testerderesta](https://wordpress.org/support/users/testerderesta/)
 * (@testerderesta)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/widget-87/#post-5350576)
 * If you wore a cape, I’d call you a superhero!
 * Thanks a lot, man! Big help!
 *  [Micah Wood](https://wordpress.org/support/users/woodent/)
 * (@woodent)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/widget-87/#post-5350583)
 * Thanks! Glad I could help!
 *  [topside](https://wordpress.org/support/users/topside/)
 * (@topside)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/widget-87/#post-5350764)
 * Hi Micah,
 * That solution doesn’t seem to want to work for me…I need to apply a floating 
   form, so I have the WPfloat plug-in installed and working, and another plug-in
   called Visual Form Builder. I am using a theme called Minamaze and I copied and
   pasted the above code into the functions.php file on that theme. The form plug-
   in is working – there is even an “add form” button on the WPfloat plugin content
   window, but all it does is display the form shortcode in plain text in my floating
   widget. Any insight into what I might be doing wrong or what else might be wrong?
   Thanks man – I appreciate it.
 *  [Micah Wood](https://wordpress.org/support/users/woodent/)
 * (@woodent)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/widget-87/#post-5350766)
 * [@topside](https://wordpress.org/support/users/topside/),
 * This thread has been marked as resolved and is specific to the mPress Image Refresh
   plugin. The best thing to do is to create a separate ticket, most likely on the
   WP Float plugin support section. This way, you’ll attract the attention of the
   WP Float plugin author.
 * The code I provided above hooks into WordPress core and basically processes shortcodes
   specifically for the WP Float plugin. I can’t think of any reason why the code
   wouldn’t work, unless your theme or a plugin is removing actions on the ‘widget_display_callback’
   hook. I’m sure there could be other reasons, but the only way to figure it out
   would most likely to delve into the code on your site.
 * You can, however, do a bit of troubleshooting on your end to determine if there
   is a plugin or theme conflict. Check out steps 3 & 4 here for details: [http://www.orderofbusiness.net/blog/troubleshooting-wordpress-plugins/](http://www.orderofbusiness.net/blog/troubleshooting-wordpress-plugins/)
 * Just be aware that switching themes when you’ve added the code to the theme could
   be a problem. 🙂 You’ll want to test by adding the code to a default WordPress
   theme and then remove it after testing.

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

The topic ‘Widget’ is closed to new replies.

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

 * 5 replies
 * 3 participants
 * Last reply from: [Micah Wood](https://wordpress.org/support/users/woodent/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/widget-87/#post-5350766)
 * Status: resolved