hey guys, I really need you help with this one.
I'm using the subscribe2 Plugin (for email subscriptions). I want to show the signup form as a widget. The plugin author recommends doing it the following way.
$content = apply_filters('the_content', '<!--subscribe2-->');
$content = remove_filter('the_content', 'page_route');
echo $content;
this works fine, except for the fact that I'm additionally using the mingle plugin (kind of a social network plugin).
Whenever I'm on a page of the mingle plugin (like /login, /register, /activity, etc.) the widget with the subscribe form suddenly displays the exact same content as the pages itself? Just weird!
Any idea why that could happen? Or how I could prevent that! I really need a solution for that!
edit: all filters mingle applies...
add_filter('get_avatar', array($this,'override_avatar'), 10, 4);
add_filter('get_comment_author_url', array($this,'override_author_url'));
add_filter('mngl-show-powered-by', array(&$this, 'show_powered_by'));
add_filter('the_content', array( &$this, 'page_route' ), 100);
add_action('wp_enqueue_scripts', array(&$this, 'load_scripts'), 1);
add_action('admin_enqueue_scripts', array(&$this,'load_admin_scripts'));
register_activation_hook(MNGL_PATH."/mingle.php", array( &$this, 'install' ));
// Used to process standalone requests (make sure mingle_init comes before parse_standalone_request)
add_action('init', array(&$this,'mingle_init'));
add_action('init', array(&$this,'parse_standalone_request'));
add_filter('request', array(&$this,'parse_pretty_profile_url'));
add_action('phpmailer_init', array(&$this, 'set_wp_mail_return_path'));
add_action('phpmailer_init', array(&$this, 'set_wp_mailer'));
add_action('admin_init', array(&$this, 'prevent_admin_access'));
add_filter('mngl-activity-types', array( &$this, 'add_activity_types' ));
add_filter('mngl-notification-types', array( &$this, 'add_notification_types' ));
add_filter('mngl-notification-types', array( $this, 'add_notification_types' ));
add_filter('mngl-activity-types', array( &$this, 'add_activity_types' ));
add_action('user_register', array(&$this, 'add_default_friends') );
add_filter('mngl-activity-types', array( &$this, 'add_activity_types' ));
echo apply_filters( 'do_shortcode', '<!--subscribe2-->');give you what you want? If that works, it might be easier than trying to remove all of the extra filters from the_content... – goldenapples Mar 24 '11 at 20:32apply_filters( 'do_shortcode', '<!--subscribe2-->'anddo_shortcode('<!--subscribe2-->'). Non of them is working - I guess because it's not really a shortcode is it? A shortcode is more like [shortcode] which can be placed inside of a normal post.<!--subscribe2-->has to be posted as html so that might be the thing. what do you mean with remove all extra filters? There must be a solution for that. Can you explain why the widget does only show the content of the current page when I'm on a mingle()-specific page? why not on all pages? – mathiregister Mar 24 '11 at 20:53the_contentthat are triggered on certain pages. You can search through the plugin's source to find out what those filters are, callremove_filterfor each of them in your widget. Then be sure to add them back after you're done displaying your widget, otherwise the regular page content will not display correctly on those pages if the widget is rendered before the post content. – goldenapples Mar 24 '11 at 21:01add_filter('the_content', array( &$this, 'page_route' ), 100);it's adding probably another 15 filters, but always to plugin specific stuff. I edited my post and added the remove_filter line. however if i so so, nothing's printed out in my widget? – mathiregister Mar 24 '11 at 21:25