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
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
Here is a quick function I had lying around that does exactly what your talking about. It uses some core WP functions to get the job done and you’ll have to modify it to fit your needs, maybe double-check on the security of the thing but it should give you a head start. function auto_function() … Read more
You can use get_blog_details() to do it. Use it the following way:– function greeting() { global $blog_id; $current_blog = get_blog_details( $blog_id ); if ( ‘one’ == $current_blog->blogname ) { echo ‘hello’; } elseif ( ‘two’ == $current_blog->blogname ) { echo ‘goodbye’; } }
/** * 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
I’ve done something similar for a client. I found it easiest to create my custom post types as part of a plugin and network activate it. Without reinventing the wheel, I used a plugin from WPMU Dev to show those posts on the main site. If creating the custom post type isn’t your forte, WPMU … Read more
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
Yes, there is a method called get_blogs_of_user($user_id); Supply the user id and echo it. http://codex.wordpress.org/WPMU_Functions/get_blogs_of_user
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’
You can filter locale for admin pages only: is_admin() && add_filter( ‘locale’, function() { return ‘en_US’; });
[*] 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