Title: GrayDuck's Replies | WordPress.org

---

# GrayDuck

  [  ](https://wordpress.org/support/users/grayduck/)

 *   [Profile](https://wordpress.org/support/users/grayduck/)
 *   [Topics Started](https://wordpress.org/support/users/grayduck/topics/)
 *   [Replies Created](https://wordpress.org/support/users/grayduck/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/grayduck/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/grayduck/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/grayduck/engagements/)
 *   [Favorites](https://wordpress.org/support/users/grayduck/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Custom sidebar code](https://wordpress.org/support/topic/custom-sidebar-code/)
 *  Thread Starter [GrayDuck](https://wordpress.org/support/users/grayduck/)
 * (@grayduck)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/custom-sidebar-code/#post-2375305)
 * Thanks a ton for the help – I got it working by removing that other line!
 *     ```
       <?php
       remove_filter( 'the_content', array($mngl_app_controller, 'page_route'), 100 );
       $content = do_shortcode( '[subscribe2]' );
       echo $content;
       add_filter( 'the_content', array($mngl_app_controller, 'page_route'), 100 );
       ?>
       ```
   
 * _[Please post code snippets between backticks or use the code button.]_
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Custom sidebar code](https://wordpress.org/support/topic/custom-sidebar-code/)
 *  Thread Starter [GrayDuck](https://wordpress.org/support/users/grayduck/)
 * (@grayduck)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/custom-sidebar-code/#post-2375271)
 * Thanks MattyRob… I’m half way there!
 * I’m stuck and my problem was addressed [here](http://wordpress.stackexchange.com/questions/12971/problem-with-implementing-widget-via-the-content).
   It looks like the solution to my problem is below:
 * > I had to figure this one out, since I’ve actually wondered for a while how 
   > to remove a filter that was passed by reference. In this case the class MnglAppController
   > which adds the filter is initiated as a variable:
   > `$mngl_app_controller = new MnglAppController();`
   >  So to remove it, you have
   > to globalize that variable, and pass it as part of the remove_filter call:
   >     ```
   >     global $mngl_app_controller;
   >     remove_filter( 'the_content', array($mngl_app_controller, 'page_route'), 100 );
   >     $content = apply_filters('the_content', '<!--subscribe2-->');
   >     echo $content;
   >     add_filter( 'the_content', array($mngl_app_controller, 'page_route'), 100 );
   >     ```
   > 
 * But I don’t know where to put:
    `$mngl_app_controller = new MnglAppController();`
   As it is, it is calling my WordSocial plugin as well.

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