GrayDuck
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Custom sidebar codeThanks 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
In reply to: Custom sidebar codeThanks MattyRob… I’m half way there!
I’m stuck and my problem was addressed here. 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.