Articles of multisite

current_user_can('Administrator') does not return true in multisite if user is Administrator but NOT Super Admin

I have a multisite WordPress installation set up, and have a user who is set to an ‘Administrator’ role on both sites. However, the function current_user_can(‘Administrator’) does not return true when logged in as them, which I expected it to. My user account, however, is an ‘Administrator’ on both sites, and also a ‘Super Admin’ […]

How to get a user role of a specific blog in multisite?

How can we get a user’s role of a specific site on a Multisite network? Let’s say the user is a subscriber on the parent site and admin of his own subdomain. Is there a way to only return the role on the parent site or by a specific blog id? Ex: get_wpmu_user_role($user_id, $blog_id);

Activate Child Theme with Codex

I know there is an option to have the following code in the wp-config.php file: define(‘WP_DEFAULT_THEME’, ‘x-child-integrity-light’); define( ‘TEMPLATEPATH’, ‘wp-content/themes/x’); I currently have this commented out and I’m trying to use the WP Replicator to replicate sites in a multisite install. I’d like to have the code automatically activate the child theme when it’s installing […]

Is there a way to run upgrade.php for one blog?

I just ran the auto update to verion 3.9 today, but am having problems with the “Network Update”. I seem to have a firewall or network problem with this error : Your server may not be able to connect to sites running on it. Error message: couldn’t connect to host Anyways, is there a way […]

Sharing Header Components Across Multisite

I have a multi-site platform and I’m trying to share the menu that I have in main with other sites that are located in different folders. This is the PHP tag in the main that pulls the menu which I also need in the header of other: <?php dokan_header_user_menu(); ?> I tried using it as […]

Multisite use language code as subdirectory

I installed WordPress in the subdiretory /de and activated multisite features. The main blog has the URL/path: Now I want to add a second site for the English language with the following url: But after I added the site, the subdirectory for the English site was set as: Any ideas how I […]

Reset WordPress website

I have a website to demo plugins, and I want to allow users to login, but I am not sure how to reset the website once they log out. Is there a way to create a separate instance of WordPress for each new user and then delete itself once that user logs out? Or is […]

delete_user_meta : how to delete all the metadata of a given user (witout SQL)

on a multisite I delete a user with: wpmu_delete_user($user_id); Fine, but unless I am confusing, it doesn’t delete the metadata which may exist for this user… delete_user_meta() seems to be the function to do this but I don’t see how to delete ALL the metadata, without entering the metakeys. (I wanted to avoid writing a […]

sunrise.php for multi-network install of domain mapping plugin

Currently using the WP-mu-domain-mapping plugin on a multi-network installation. The domain mapping works fine with the provided sunrise.php file, however it breaks (sites no longer map correctly) when I move the plugin to our mu-plugins directory. I’ve tried the following, but it doesn’t work. <?php $sunrises = array( “dm_sunrise” => dirname( __FILE__ ) . “/mu-plugins/domain-mapping/inc/sunrise.php” […]

wp_redirect not working on admin menu page

Im trying to create a admin menu link on the backend dashboard, that will take users to the front end of their site. Im trying to use this code, but for some reason the redirect is not working. // Custom Menus add_action(‘admin_menu’, ‘register_web_menu_page’); function register_web_menu_page() { add_menu_page(‘View My Website’, ‘View My Website’, ‘add_users’, ‘web_menu_page’, ‘web_menu_page’, […]