[wp-trac] [WordPress Trac] #14941: switch_to_blog() runs with active plugins of original blog
WordPress Trac
wp-trac at lists.automattic.com
Wed Sep 22 20:13:38 UTC 2010
#14941: switch_to_blog() runs with active plugins of original blog
--------------------------+-------------------------------------------------
Reporter: madtownlems | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
The short:
If I'm blog 1 and I switch_to_blog(2), I'm still running in the
environment of blog 1. All blog 1's activated plugins are active, and not
all of blog 2's plugins necessarily are.
The long:
I first ran into the problem trying to get Subscribe2 (S2) to work well
with Site Wide Tags (SWT).
SWT basically works like this:
When someone makes a post on their blog:
switch_to_blog(aggregrate_blog_id);
wp_insert_post(...);
restore_current_blog();
S2 says that whenever someone inserts a post, to send an email alert out.
With both of these plugins enabled, a post always generates TWO emails,
regardless of whether S2 is active on the aggregate blog. The same is
true for any behavior that triggers on a new post being created (such as
automated tweeting, etc).
I feel that, if I'm really switching to that blog, I should be running
more comprehensively as it. That is, with its plugins active, and none of
its un-activated plugins active.
The examples of conflicts I gave are blog behavior, and are more or less
just annoying, but I could easily see this causing unforeseen security
flaws as well.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14941>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list