Title: cLin's Replies | WordPress.org

---

# cLin

  [  ](https://wordpress.org/support/users/clin/)

 *   [Profile](https://wordpress.org/support/users/clin/)
 *   [Topics Started](https://wordpress.org/support/users/clin/topics/)
 *   [Replies Created](https://wordpress.org/support/users/clin/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/clin/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/clin/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/clin/engagements/)
 *   [Favorites](https://wordpress.org/support/users/clin/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 67 total)

1 [2](https://wordpress.org/support/users/clin/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/clin/replies/page/3/?output_format=md) [4](https://wordpress.org/support/users/clin/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/clin/replies/page/5/?output_format=md) [→](https://wordpress.org/support/users/clin/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[W3 Total Cache] CDN und SRCSET](https://wordpress.org/support/topic/cdn-und-srcset/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/cdn-und-srcset/#post-6487062)
 * Looks like this is still a problem. Anyone have a fix?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Join My Multisite] Add users from Admin section always default role?](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/)
 *  Thread Starter [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/#post-4537535)
 * Yep 😀
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Join My Multisite] Add users from Admin section always default role?](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/)
 *  Thread Starter [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/#post-4537528)
 * I just ended up fixing it by adding this:
 *     ```
       $role = (isset($_POST['role']) && isset($_POST['user_login'])) ? $_POST['role'] : get_site_option( 'default_user_role', 'subscriber' );
       	add_user_to_blog( $blog_id, $user_id, $role );
       ```
   
 * I’m assuming the role name isn’t used anywhere else and just added user_login
   to narrow down the possibilities. Seems to put in the correct roles based off
   my testing, do you see any issues wrong with this method?
 * Also, I put that under the jmm_activate_user function, not the join site function
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Join My Multisite] Add users from Admin section always default role?](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/)
 *  Thread Starter [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/#post-4537449)
 * Also, in my particular case, I’ve just been bypassing activation by checking 
   the Skip Confirmation Email box.
 * is there a way to add a condition to fire the add_user_to_blog only if the user
   ID being added matches the current user? So in my case, since I’m adding someone
   else, add_user_to_blog won’t fire and WP will add the role.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Join My Multisite] Add users from Admin section always default role?](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/)
 *  Thread Starter [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/#post-4537443)
 * Yea, I understand the automatic membership, that seems to work perfectly, I just
   don’t know why [when adding from here](http://imgur.com/CcxYndI) no matter what
   role I choose, it still sets it as the default one. Once, I disable JMM though,
   the roles are set based off what I choose. Of course, I also lose the automatic
   membership.
 * Since you add the action to “init” would that also be added on the user add section?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Join My Multisite] Add users from Admin section always default role?](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/)
 *  Thread Starter [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/#post-4537434)
 * NEW users to the network. I have automatic membership.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Join My Multisite] Add users from Admin section always default role?](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/)
 *  Thread Starter [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/add-users-from-admin-section-always-default-role/#post-4537424)
 * Ok, digging around the code, it seems like this section may be part of the problem?
 *     ```
       function join_site( ) {
             ....
               if( !is_user_member_of_blog() ) {
                   add_user_to_blog($blog_id, $current_user->ID, $jmm_options['role']);
               }
           }
       ```
   
 * Does it go off even when in site admin or only when they are viewing the non 
   site admin portions?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/page/2/#post-2829756)
 * Hi Maxaud,
 * Were you able to get tag support on this? Tags don’t seem to be broadcasting 
   right now when I create a new site?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/page/2/#post-2829753)
 * Yep. It was the timeout thing. increased to 10 minutes and it works fine (I had
   a lot of posts with images on my master blog).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/page/2/#post-2829751)
 * Well I increased the time limit to 10 minutes and it seemed to move all the data.
   Seems like if it timeouts too quick it doesn’t even partially process the data.
 * What does 10,6 do to the function?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/page/2/#post-2829749)
 * just the following…Looks like the script timeouts. I increased it to 2 mins and
   it barely got through 1/3 of my posts (probably from the images). I can temporarily
   increase the timeout by putting
    set_time_limit(300); in the function that runs
   the loop right? I’m trying to avoid making the whole site have a timeout of 5
   minutes long.
 * [Tue Oct 02 17:53:05 2012] [error] PHP Fatal error: Maximum execution time of
   30 seconds exceeded in /usr/www/virtual/username/www.domain.com/wp-includes/media.
   php on line 435, referer: [http://www.domain.com/wp-admin/network/site-new.php](http://www.domain.com/wp-admin/network/site-new.php)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/page/2/#post-2829747)
 * Well, the two things needed for the loop is just $post->ID and $blog_id right?
   If that’s the case, both are outputting the correct information.
 * Is there anything in the function you wrote to be placed in the class that would
   be custom to your setup (besides masterblogid which I changed)? I’m using the
   latest version of WPMU and WP
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/#post-2829745)
 * $posts_ids is returning an array of post ids. I found an error with the sql statement
   which I’ve fixed and now it seems to take a bit longer to add a site but it does
   not seem to add any posts.
 * I’ve replaced all occurences of MASTERBLOGID in both functions.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/#post-2829743)
 * Awesome. No more errors but the posts don’t seem to be broadcasted when I make
   a new site. Any ideas? The only thing I modified was adding your function next
   to the save_post() function and adding the edited function above that I pasted
   into my theme functions.php file.
 * I also echoed $blog_id and it outputted the newest blog_id (I was worried I set
   it up wrong). Did I hook it into the right function?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Broadcast] [Plugin: ThreeWP Broadcast] Broadcast to newly created blogs?](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/)
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-threewp-broadcast-broadcast-to-newly-created-blogs/#post-2829741)
 * Weird, i’ve put this code in my functions.php in my theme folder
 *     ```
       function pull_content_from_master_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) {
       	switch_to_blog( 1 );
   
       	$sql = '
       		SELECT ID
       		FROM ' . $wpdb->base_prefix . '_posts
       		WHERE post_type IN ("post","page","articles","videos")
       		';
       	$post_ids = $wpdb->get_results( $sql );
       	foreach ( $post_ids as $post ) {
       		$broadcast = new ThreeWP_Broadcast;
       		$error = $broadcast->CMHL_save_post($post->ID,$blog_id);
       	}
       	restore_current_blog();
       }
       add_action( 'wpmu_new_blog', 'pull_content_from_master_blog' );
       ```
   
 * adding the other post types and altering the sql query (everything is pulled 
   from the first site which i noticed isn’t formatted like wp1_posts but I get 
   the following error when I try to make a new site
 * > PHP Fatal error: Call to a member function get_results() on a non-object in/
   > usr/www/virtual/username/www.domain.com/wp-content/themes/v2/functions.php 
   > on line 377, referer: [http://www.domain.com/wp-admin/network/site-new.php](http://www.domain.com/wp-admin/network/site-new.php)
 * Any thoughts? Sorry, I’m a bit new with WP hooks

Viewing 15 replies - 1 through 15 (of 67 total)

1 [2](https://wordpress.org/support/users/clin/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/clin/replies/page/3/?output_format=md) [4](https://wordpress.org/support/users/clin/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/clin/replies/page/5/?output_format=md) [→](https://wordpress.org/support/users/clin/replies/page/2/?output_format=md)