0
votes

I am trying to create a Wordpress MU admin plugin, that will insert some JavaScript code into every admin page that my users see.

I created my own plugin, and activated using the "Activate Plugin Site wide" link.

I have been testing with the following code, which works on existing blogs.

add_action("admin_footer", 'testAdminFooterHook', 5);

function testAdminFooterHook()
{
    echo "<script language='javascript' >\n";
    echo "alert('test admin_footer hook')";
    echo "</script >\n";
}

However, if I create a new user and a new blog, and then log in -- the plugin does not fire.

Am I approaching this wrong? How can I create an admin plugin that will fire for every future user created and every future blog created? I'm running Wordpress MU 2.8.4.

1

1 Answers

2
votes

Ok, I'll answer my own question.

I just had to put the php file in the /wp-content/mu-plugins directory.

It now fires for on every admin page, including ones new users and new blogs. Although, you do have to put a php file in the /wp-content/mu-plugins directory - putting a your plugin code inside a folder does not work.