How do I use different domain for subdomains in WP Multisite?

Let’s establish the baseline: it is possible to have the main site in example-domain-x.com and all subsites subdomains in example-domain-y.com. You just add subdomain1.example-domain-y.com (or subdomain2.example-domain-y.com, subdomain3.example-domain-y.com) like you would be adding a bare or www domain in the domain mapping panel ( URL containing wp-admin/network/settings.php?page=dm_domains_admin ). To achieve the same programmatically, you could hook … Read more

Creating a Post form outside of the Admin

Ok I have cracked it, by spoofing the $_SERVER variable and pre-defing some constants, I was able to prevent WordPress from redirecting after the inclusion of wp-load.php. define(‘WP_USE_THEMES’, false); define( ‘DOMAIN_CURRENT_SITE’, $siteRow[‘domain’] ); define( ‘PATH_CURRENT_SITE’, “https://wordpress.stackexchange.com/” ); define( ‘SITE_ID_CURRENT_SITE’, 1 ); define( ‘BLOG_ID_CURRENT_SITE’, $siteRow[‘wp_blog_id’] ); $_SERVER = array( “HTTP_HOST” => $siteRow[‘domain’], “SERVER_NAME” => $siteRow[‘domain’], “REQUEST_URI” … Read more

Transients API and multisite

Default Transient API behavior is to use Options API for storage and so behavior identical to options. However if there is external object cache (declared by plugin or whatever) then they get stored using object cache functions instead. So basically it will work in scope of current site, unless there are plugins that make it … Read more

How to remove the Tools menu item from the WP-Admin menu

You want to use remove menu page. <?php add_action( ‘admin_menu’, ‘wpse26980_remove_tools’, 99 ); function wpse26980_remove_tools() { remove_menu_page( ‘tools.php’ ); } You can drop that in your functions.php file (without the opening <?php most likely). That’s not going to prevent people from typing in yoursite.com/wp-admin/tools.php and seeing the tools page, however.

No Network/Super admin after enabling Network

I installed WordPress 3.2.1 fresh on a new domain, and then enabled Multi-Site, which functioned as documented. I could reach /wp-admin/network without problems. Comparing the database of this WP with the problem installation, in the wp_sitemeta table, admin_email was not set for the problem site. Also, wp_sitemeta > site_admins was different. The problem website had … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)