Multisite, Add Caps To All Blogs Within Network.
-
This code is strictly a example, for my question below.
define( 'PLUGIN_CAP', 'Plugin Cap Control' ); register_activation_hook( 'file-with-code-init.php', 'on_activate' ); function on_activate() { $role = get_role( 'administrator' ); if ( !empty( $role ) ) { $role->add_cap( PLUGIN_CAP ); } } if ( current_user_can( PLUGIN_CAP, $user_ID ) ) { do something }
So I’ve been toying around with WordPress Roles and Capabilities, multisite enabled and I have two blogs setup. So, when I install my test-plugin via the “Network Admin” the code above won’t be processed through each individual blog that is apart of the Network. Why is that?
How would I go about this? I’ve read that get_blogs_list() is discontinued. That was my main idea, loop through each blog and set my Capabilities…
Any suggestion would be greatly appreciated.
** I apologize for putting this post into the wrong forum section… If it could be movied, since I’m unable too.
- The topic ‘Multisite, Add Caps To All Blogs Within Network.’ is closed to new replies.