Basically I'm trying to work with xmlrpc and control the application remotely and i've got most of it working except this doesn't seem to be working, although I could be wrong. I've not thoroughly tested it.
Basically I'm trying to work with xmlrpc and control the application remotely and i've got most of it working except this doesn't seem to be working, although I could be wrong. I've not thoroughly tested it.
7430 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Erstwhile founder
—
15th September 2009 (2 years ago)
#
In that case you need to trigger the function via a hook. Actually since you seem to need to call the function within the switch_to_blog section you'll probably need to toss the entire section of code into a function and then trigger that function via a hook.
Responses (7)
Keeper of the Dark Chocolate — 13th September 2009 (2 years ago) #
Not a clue with xmlrpc. Sorry. I don;t get that fancy.
Member — 13th September 2009 (2 years ago) #
what about controlling another plugin with another plugin.?
Thanks
-Brad
Erstwhile founder — 14th September 2009 (2 years ago) #
Hiya,
I'm afraid I really don't understand what you're attempting to do.
Thanks,
Andrew
Member — 15th September 2009 (2 years ago) #
I have my plugin, I want it to interact with another plugin. aka run some of it's functions or methods.
example:
$blog_id =3
$switch = true;
switch_to_blog( $blog_id );
call_user_func(wpsc_clean_categories);
//do_action('admin_init', 'wpsc_clean_categories');
call_user_func(wpsc_update_page_urls);
//do_action('admin_init', 'wpsc_update_page_urls');
restore_current_blog();
When I run this code it doesn't work.... I tried with call_user_func, do_action, I don't know where to go now.
another example, I would like to run the supporter create new supporter programically, vs having to go into the admin, run it for that blog id.
-brad
Erstwhile founder — 15th September 2009 (2 years ago) #
Hiya,
Instead of this:
call_user_func(wpsc_clean_categories);
Try this:
wpsc_clean_categories();
You might want to hire a developer for an hour or two to help you out.
Thanks,
Andrew
Member — 15th September 2009 (2 years ago) #
when I tried running it directly it didn't find the function.. I'm guessing plugins get initiated after mu-plugins get initiated.
-Brad
Erstwhile founder — 15th September 2009 (2 years ago) #
In that case you need to trigger the function via a hook. Actually since you seem to need to call the function within the switch_to_blog section you'll probably need to toss the entire section of code into a function and then trigger that function via a hook.
Information on hooks can be found in the codex:
http://codex.wordpress.org/Plugin_API
Thanks,
Andrew
Become a member