Note that you should be able to map domains without 3rd party plugins.
Here’s an untested suggestion for your callback in your current situation:
global $wpdb;
// Nothing to do if not multisite
if( ! is_multisite() )
return;
// Define the custom table
$wpdb->dmtable = $wpdb->base_prefix . 'domain_mapping';
// Check if the custom table exists
if ( $wpdb->dmtable != $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->dmtable}'" ) )
return;
// Check if current site is mapped
$domain_exists = (bool) $wpdb->get_var(
$wpdb->prepare(
"SELECT COUNT(blog_id)
FROM {$wpdb->dmtable}
WHERE blog_id = %d AND active = 1 LIMIT 0,1",
get_current_blog_id()
)
);
if( $domain_exists )
{
// do something
}
Related Posts:
- How to use WordPress Multisite With Different Domain Names?
- Can a multisite’s blogs be accessible from two different sub-domains?
- Domain mapping (without plugin) in 4.5.x multisite?
- Multisite Domain Mapping with SSL
- How to set up wordpress domain mapping on MAMP Pro
- How to use alias domain for multisite installation?
- WordPress Multisite with multiple domains using Nginx
- Steps for Moving Multiple WordPress Installs to a Multisite Install?
- Multisite posts in categories on network
- find a random blogid across my multisite network that has at least one post published
- sunrise.php for multi-network install of domain mapping plugin
- Infinite loop problem with the WordPress MU Domain Mapping plug-in
- Is it still only possible to do multisite domain mapping with a plugin in WordPress 4.1?
- How to manage multiple domain with different languages on each domain with single wordpress installation?
- “Preview Changes” button doesn’t show changes for previously published posts/pages
- How to add new sites and map a custom domain in WordPress Multisite?
- WordPress multisite with different domain
- Trying to migrate a WordPress Multisite with Domain Mapping
- Multiple blogs, different domain names, one install to rule them all
- Hide root site in Multisite install
- Creating a Post form outside of the Admin
- How do I use different domain for subdomains in WP Multisite?
- subdomain mulitsite on localhost in a subfolder
- WordPress Network for regional company websites
- How to do Domain Mapping to Subdirectories?
- Possible to create a multisite network where the main site is non-WP?
- Using $wpdb Class to Pull Recent Comments Across a Network
- How do I park secure.primary.com on top of the multisite ID:1 domain: www.primary.com (primary multisite domain)
- Multiple domains with different child themes on one installation?
- How to order by blog ID in this multisite ‘List Blogs’ custom function
- WordPress multisite with multiple parent domains
- WP 4.4 – domain mapping for sites within a multisite network?
- WP MU – Accessing ‘Domain-Mapped’ WP-Admin with a subdomain
- Bootstrapping WordPress MultiSite Outsite of WordPress – No $wpdb
- Child Site doesn’t appear in the Network menu
- Create rewriterules for different domains in htaccess file with WP multisite
- Multisite domain naming
- Optimizing Query used for a Shortcode
- WordPress MU Domain Mapping Just Redirects to Main Site
- WordPress Multisite domain mapping with different IPs
- WordPress Multisite with Addon Domains (not parked domain) [closed]
- Use WordPress MultiSite (WPMS) with a remote database for each created site
- Mapping domains to WordPress network installed on subdomain
- WordPress 4.5+ Multisite Domain Mapping
- Link structure, WordPress IIS
- Multisite – Parent site with Polylang with different domains for each language [closed]
- Viewing / Editing A Multisite website after domain has expired
- WordPress Multisite + Erros with URLS and ADMIN
- Login problems on multisite installation with different domains
- Is this a job for WP MultiSite with domain mapping plugin?
- MU/Subdomains + Domain Mapping + SSL?
- network site domain mapping still applied after being removed
- How to set up wordpress domain mapping on MAMP Pro
- Domain Mapping for WordPress MU and https redirection – How to?
- Canonical Resource URLs Across a Multisite Network 2012?
- How to display users with posts published between two dates (Sorted by Post-Count) [Multisite]
- Multisite domain mapping breaks CSS
- WordPress MU subdomain vhost
- Domain mapping with Multisite links are wrong
- How to Deny Access to No Referrer Requests on Multiste with Mapped domains
- Install multisite wordpress on a subdomain and map to top level domains
- Multisite – One Site with multiple URLs
- Sub-sub folders of WordPress Multisite subdirectory
- WordPress Multisite with subdomains on different domains
- Domain Mapping subsites of an Add-on Mulsite Domain
- Change WordPress Multisite Domain
- Multi-site site nav, wpdb->prepare missing argument
- Forward and mask a WordPress website
- How to Force WWW. in Domain With WordPress MU Domain Mapping Plugin?
- wordpress multisite domain mapping redirects to original subdomain
- WordPress Multisite and how to apply sef urls only to specific sites
- multisite installed on subdomain now want another subsite on subdirectory
- Migrating from domain mapping plugin to native domain mapping
- How to map domains to specific pages in WordPress and display them in the address bar?
- WordPress Multisite – Domain Mapping
- WordPress Multisite with Wildcard Certificates not mapping correctly
- Login issues on WordPress Multisite and domain mapping
- SSL for Mapped Domains with WordPress Multisite on AWS
- Multisite domain mapping with SSL redirects to main domain
- Multisite htaccess with domain rewrites
- WordPress Multi site Map Domains
- new WPMS site not working / Q setting up new site/subdomain
- Multisite with different domain names
- Optimal setup for Multi Domain WordPress with Woocommerce
- How to implement this subdirectory mapping in multisite?
- MU domain mapping without using a plugin
- Domain mapping breaks some plugin scripts and css
- How to configure WordPress for multiple blogs without using multisite?
- Subdirectory and domain multisite installation
- WP DB Location for “Next Post to Create” Index Value
- Multisite: Run a subdomain install from a directory install
- WordPress Domain Mapping shows new domain in place but takes me to the sub domain
- Run “get_the_post_thumbnail” with a different table prefix?
- MU Domain mapping
- Multisite redirect loop for a single www domain
- Some Subdomains on a Multisite Install Not Found
- Best Way to Setup a Network of WP Sites?
- Map WP Multisite blog.example.com to anotherdomain.com/blog?
- Multisite with Static home page mixed with separate domain name
- Have two domains point to the same content on a wordpress multisite