create /blog subsite on WordPress multisite
You can’t. That’s part of the main site’s permalink structure. There’s no way to get around it. You can find more information here: http://core.trac.wordpress.org/ticket/13527
You can’t. That’s part of the main site’s permalink structure. There’s no way to get around it. You can find more information here: http://core.trac.wordpress.org/ticket/13527
add_blog_option ultimately calls add_option itself to add the option after switching the context to the supplied blog ID. the difference is that add_option will only work in the context of the current blog where add_blog_option lets you specify a blog ID that may be different than the current context.
Run add_user_to_blog() after user creation. You can hook on user_register() to get newly created user ID and pass it and any conditional assignments to your callback that runs add_user_to_blog().
Made a couple of tweaks to brasofilo’s example as we were getting hit with memory execution issues; one of which may be related to a possible switch_to_blog memory leak that has been impacting sites doing a lot of switch_to_blog calls (we would typically run around ~1000 or so when loading this dashboard widget.) Even with … Read more
When WordPress builds such a list, it runs a check against the function wp_is_large_network(). It sets a limit of 10000 for users and sites, and when you hit that limit, expensive database operations aren’t executed anymore. There are two filters with the same name, so you can change the limit. Example: add_filter( ‘wp_is_large_network’, function( $state, … Read more
I spent several hours of my Saturday looking for this error. I could not find a guide anywhere on the ‘net that described my eventual solution. Here is my solution. In the WP core, the “You do not have sufficient permissions to access this page.” error is generated at the end of /wp-admin/includes/menu.php. A grep … Read more
You have to run through each blog and fetch the recent attachments with: $args = array ( ‘post_type’ => ‘attachment’, ‘numberposts’ => 30 ); $attachments = get_posts( $args ); Dashboard widgets are registered on wp_network_dashboard_setup in multi-site and wp_dashboard_setup in single-site. Make sure to add the following line to the plugin header to get the … Read more
You are right, this is very hacky. What I ending up doing was creating two new page templates Register and Activate and creating two new WordPress pages using those templates and then using a filter in my functions.php file to modify the behaviour one wpmu_signup_user_notification. Users will register on this new Register page and they … Read more
Your sites look nothing alike. Open those three links – and there is not a single element that binds all three sites together. Network of sites can benefit from consistent looks. You could use global “about” page that covers all of your activity and not just bits in context of specific site. Consider building landing … Read more
I recommend creating a function in your functions.php file that ties to the action hook activate_blog. Use the WordPress functions get_pages() to see if your default pages exist. If they do not, create them with wp_insert_post. add_action(‘activate_blog’,’my_default_pages’); function my_default_pages(){ $default_pages = array(‘About’,’Home’,’My Store’,’My Address’); $existing_pages = get_pages(); foreach($existing_pages as $page){ $temp[] = $page->post_title; } $pages_to_create … Read more