Get the User ID Who Owns a Given Blog ID in Multisite
I know this is old, but this is the best way. Might help people coming here in the future. $get_users = get_users( array( ‘blog_id’ => get_current_blog_id() ) ); $user_id = $get_users[0]->ID;
I know this is old, but this is the best way. Might help people coming here in the future. $get_users = get_users( array( ‘blog_id’ => get_current_blog_id() ) ); $user_id = $get_users[0]->ID;
wp-login was not found error clearly means that you have lost control on WordPress admin panel. Even if this situation looks terrible but in real, it’s not. Situation A: The URL might be wrong In most cases, the WordPress installed in its own directory. When a user tries to change the default URL path of … Read more
Yeah, there are a little more steps involved with Multisite. Here’s how I did this for a recent project, after much mucking around: Set up virtual hosts rather than subfolders on your WAMP box I’m on XAMPP so this will be a little different for you, but for me I just needed to add the … Read more
When building a page, WordPress looks in the option table in the database which theme to use. This read action can be intercepted, as you can see from the fact that you can live preview themes (more extensively with a plugin). So, if you want to build something like this yourself, you would have to … Read more
As the Codex suggests: Essentially the same as set_transient() but works network wide when using WP Multisite. One difference is that the transient name should be 40 characters or less in length. Also, while set_transient() sets transients that have an expiration time to not autoload, all transients added with set_site_transient will auto-load at all times. … Read more
This was the solution.. // different author template */ add_filter( ‘template_include’, ‘author_template’, 99 ); function author_template( $template ) { if( !is_main_site() and is_author( ) ) { $new_template = locate_template( array( ‘other-author.php’ ) ); if ( ” != $new_template ) { return $new_template ; } } return $template; }
There’s a couple of different ways that might work, but both rely on using Apache/NGINX directives. Method 1 Setup WordPress MS at mydomain.com, create an admin.mydomain.com site and then redirect mydomain.com to admin.mydomain.com. All additional sites would naturally be subdomains to mydomain.com. Method 2 This is basically the inverse of Method 1. You should be … Read more
Depending on which email provider you use, the easiest way is probably to use the [email protected] format. Many common email systems will deliver mail as though it were addressed to [email protected]. The +tag portion of the email address can then be used both for filing mail and for screening it. WordPress, however, will see it … Read more
See the answer here: Password Reset for Users on a Multisite Subsite . It shows the code that a plugin uses to set the link to the subsite’s lost password, rather than the main site (which is what WP does by default). You could add that code to your Child Theme’s function.php (so you don’t … Read more
Yes it will give you infinite loop, because you’re calling the WP_User::set_role method within the set_user_role action that’s again fired within the the WP_User::set_role method. Not sure what the setup is but you can try to run it only once, with remove_action( current_action(), __FUNCTION__ ); as the first line in your callback, or use another … Read more