Some of the more archaic code is still present in WordPress, notably globalising variables inside functions. A good example of thise is get_current_blog_id()
, which is present in wp-load.php
:
/**
* Retrieve the current blog ID.
*
* @since 3.1.0
*
* @global int $blog_id
*
* @return int Blog id
*/
function get_current_blog_id() {
global $blog_id;
return absint($blog_id);
}
This means that you could potentially run into issues if you set $blog_id
yourself in your theme. This goes for $current_site
and some other variables too.
By the sounds of your questions I’d guess you’re building a theme or plugin yourself, so there’s a good chance you’re using the above variables. Good practice is to prefix your variables with something unique to your theme.
Related Posts:
- restore_current_blog() vs switch_to_blog()
- Anyone figured out how to use WordPress MultiSite with Domain Mapping & SSL?
- What do I need to do to convert my MultiSite from HTTP to HTTPS?
- WP Multisite development with Mamp Pro and wildcard subdomains, not really working for me
- SSL wildcard issue for wp multisite subdomains
- How to set configuration options for particular sub blogs?
- REST API for Multisite
- How can I display all Multisite blogs where this user is administrator?
- Organize uploaded media files
- How to upload images manually to wordpress?
- MU domain mapping login issue
- Generate a user list per site to communicate upgrade plans
- Get all terms inside a specific taxonomy in a multisite
- Adding capabilities to super admins
- Run a function when a new site is created in WordPress Multisite
- Getting a blog language (site “lang_id” field vs the WPLANG setting)
- wp-admin slow in multisite
- Can’t add user to blog on registration (Multisite)
- Sub-directory blog on a sub-domain WordPress network site
- Add New Sub Site from the WordPress back end then in sub site options table option_value must be with https
- Customizing Deleted/Archived blogs warning pages
- SQL Query to Get list of all users along with their blogs
- Synchronizing Two WordPress Sites Content
- W3 Total Cache – How to disable “Performance” menu under multisite? [closed]
- How to clone and locally run a network for testing
- Multisite Independent User Base
- How to prevent first post and first comment on WP MU?
- Why is my multisite installation not showing all the available sites?
- Is Partial SSL Possible? ( multisite )
- In Multisite “Sites” list, what do “deactivate” and “archive” really do?
- WP_INSERT_POST issue on WordPress Multisite
- PHP Notices appear when browsing any page in admin, but only for child theme, using code from WP Codex
- How to Rename wp-login.php for Multisite?
- What is the most efficient way to have two “blogs” on one site?
- Preview posts returns 404
- How can I have multiple URLs pointing to single WordPress installation?
- How to exclude a directory from WordPress permalinks in a Multisite environment?
- Does WordPress MultiSite use separate MySql databases?
- Create a network of blogs with WordPress 3
- Retrieving data from specific multisite blog
- Error 404 on Network Admin and others
- Network Plugin Creating Pages for Different Subdomains
- Get just subdirectory name from a multisite URL
- Problem uploading images
- Multisite – 404 when accessing sub-sites
- Redirect Site Geologically
- WordPress Network admin options page: how to store options and where will they be stored?
- Multisite: How can I have the admin bar (toolbar) use the language of the user instead of the language of the sub-site being viewed?
- .htaccess rules for blocking bots with an extra condition
- Wrong filepaths and admin page infinite reload after migrating to aws bitnami
- Multisite not using subdomains as hostname in from address when sending emails
- Do I need a Multisite? [closed]
- How to host unrelated pages on WordPress domain
- How can I overhaul a live MultiSite network?
- Update configured themes
- Multi-Site Subfolder User Permission Issue
- Programmatically Add Item to WP Multisite Menus
- why there is a large file named core in wpmu’s directory?
- WordPress multi-site, developing locally and syncing live changes
- wp_get_attachment_image_src on multisite
- Problem with parked domain for my mutisite
- WordPress multisite – What’s the ideal setup for development/staging/production environments?
- WordPress self hosted site asking to login again when used www
- Changed sub-site to its own domain trigger 302 redirects for all page links
- Multisite – big hosting package or several hosting packages?
- WordPress network vs Separate installs
- 404 on page 2 multisite
- How can I append blog_id to … echo [functions-defined-constant]?
- Page Builders and WP Multisite
- WordPress Multisite Add User
- Some permalinks are not working and show 404
- WP MS: How to query over the network
- unable to access network admin of a blog
- Is a multisite install what I need?
- Infamous admin login redirect
- WordPress Multisite Permalinks on mapped domain = server 404 error
- Sites network with sub-folders
- Manually Moving Posts/Pages/Comments/Tags from WPMU to WP3.0
- Setup another new subdomain root on top of multisite configuration
- WordPress keeps deleting user account for multisite after loggin out i need your help please?
- Create link preview for theme wordpress
- Language per user role, how can I achieve this?
- Internet explorer not finding right content from multisite
- Change WordPress multisite to sub-folder installation
- How to add a link of “one” website in posts of “second” website in multisite WordPress
- Themes are visible in Network, but invisible in sites
- logging out with/without confirmation – single site, multisite
- No debug log for WP multisite is created
- Multisite different domains mapping error on GGS
- Main site media are accessible in subsite domain
- Multisite – each site with it’s own set of users
- Including non-wordpress pages within a single multisite domain
- WordPress Multisite wp-admin/ redirect loop but adding index.php works fine
- Migrate site from WordPress multisite to another WordPress multisite
- WordPress Multisite redirect loop
- Split a Multisite Into Single WordPress Websites
- Is it possible to put a site other than #1 as a Multisite top-level domain?
- Should I go for Multisite or separate WP Installation?
- Multiple WordPress sites on one hosting [closed]
- different image for mobile template block theme