Support » Plugins » WPMU writing a plugin for site-wide activation

  • Hi,

    I have written my own plugin which I want activated site-wide to all my users’ blogs. I am using the admin_footer hook, because I want this plugin to fire each time an admin page displays.

    As the admin user, I have activated my plugin site wide. The plugin works for me as admin user.

    Next, I self-registered “UserA” and a new blog was automatically created. However, the plugin is not firing for UserA.

    I have been debugging the code and traced all the way into plugin.php

    do {
        foreach ( (array) current($wp_filter[$tag]) as $the_ )
            if ( !is_null($the_['function']) )
                call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));

    My function does not appear in $the_[‘function’] as UserA, but it does as admin.

    Can anyone explain why this would be happening?

    Here is how I tested and debugged. My plugin looks like this:

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

    Have I forgotten to do something? I want to impose this plugin on all my site’s users.

    The strangest part is that if I log in as administrator, and view UserA’s blog dashboard, then everything works. It’s as if as soon as the admin touches the blog, the plugin is registered.

  • The topic ‘WPMU writing a plugin for site-wide activation’ is closed to new replies.