Multitenant with a single site

Before I learned about WordPress network solution I went with option two – setting up certain privileges to users to be able to view and edit content only authored by (and for) them. That can be accomplished by using almost any WP plugin that allows you to change permissions per user, and a few functions … Read more

add_blog_option blog ID

In multisite each blog/site gets his own tables with the blog id in the prefix, so once you install a network installation your database should have these tables: wp_1_options wp_2_options

Hiding media uploaded by other users in wordpress multisite?

/** * Allow access to own content only */ function my_authored_content($query) { //get current user info to see if they are allowed to access ANY posts and pages $current_user = wp_get_current_user(); // set current user to $is_user $is_user = $current_user->user_login; //if is admin or ‘is_user’ does not equal #username if (!current_user_can(‘manage_options’)){ //if in the admin … Read more

Is this a good case for Multisite?

Use multisite for the following reasons: 1.) You can have the same login credentials for each site, so users that need to get into admin don’t need to remember what site credentials to use. 2.) Depending on how your sites are setup a free plugin like “WP (three?) Broadcast” can let you copy pages/posts from … Read more

unable to access network admin of a blog

The problem was that the username of the super admin was changed and this did not reflect in other blogs of the system. The below query solved my problem, update wp_sitemeta set `meta_value` = ‘a:1:{i:0;s:6:”adminusername”;}’ where `meta_key` = ‘site_admins’ and update wp_sitemeta set `meta_value` = ‘[email protected]’ where `meta_key` = ‘admin_email’

WP MS: How to query over the network

[*] Each site in a Multisite network is considered to be exactly that — a separate site. All the $wpdb values (eg, $wpdb->posts) are distinct for each site. You can use switch_to_blog() and restore_current_blog() to get content (posts, etc) from the various sites[*] in your network: $sites = array( 1, 2, 3, ); $all_posts = … Read more