2 months, 2 weeks ago jockebqParticipant
I have WP Ultimo setup so that the user can add multiple sites to the same account. This works great. But the problem is that I use this function for some parts of my site:
$blog_id = get_user_option( ‘primary_blog’, $user_id );
$blog_details = get_blog_details( $blog_id );
$primaryblogname = ( $blog_details->blogname );
I just pasted the important part.
What I acheive with this is that I am able to get the ID and name of the primary blog of the user. But the issue here is that this changes each time I create a new site.
So say my user registers and creates a site called site1 and then later on adds a site called site2 to the same account. The function above will now return site2 instead of site1. How do I make sure that the primary site is always the first site the user creates (the one that is created on registration)?
Thank you!2 months, 2 weeks ago Arindo DuqueKeymaster
The default behavior is to keep the first site as the primary even if new ones are added. I checked locally and my install behaves that way and the user keeps the original blog as its primary. I would check the rest of your customization code to make sure you are not resetting the primary blog anywhere.
You must be logged in to reply to this topic.