Install multisite wordpress on a subdomain and map to top level domains
Make sure your webhost gives you the ability to use WildCard DNS. I know some hosts such as Dreamhost don’t allow it on their shared hosting plans.
Make sure your webhost gives you the ability to use WildCard DNS. I know some hosts such as Dreamhost don’t allow it on their shared hosting plans.
Most of these files are in wp/admin/network. But be aware that some are just wrappers for regular admin files one level up: they include the corresponding file. What you probably need are the hooks and the function is_network_admin() that checks if you are currently on a network admin page. Most hooks and global variables are … Read more
There’s an action hook in the set_role function. It’s a matter of detecting if this is happening in the main site, and, if it does, get all blogs of the user and change all roles. More details in code comments. add_action( ‘set_user_role’, ‘sync_user_roles_wpse_91745’, 10, 2 ); function sync_user_roles_wpse_91745( $user_id, $role ) { // is_multisite() used … Read more
It depends on your user account structure. The superadmin of the MU can always edit anything and you cannot lock that one out for obvious reasons, but you can remove all other users from that 1 website you want to lock down. Go to Network Admin > Sites > Edit (link) and then in the … Read more
I found this stray code in the header.php $GLOBALS[blog_id] = get_option(‘woo_blog_id’); This wiped out the global variable that get_current_blog_id() relies on to get the site id in multisite. This is then used by wp_get_attachment_url() to build the appropriate URL. Because I was getting an incorrect site id, my attachment URLs were coming out wrong.
Non-Multisite setup: You need to create another instance of the WPDB Class. $newWPDB = new wpdb(‘Username’,’password’,’database’,’localhost’); $rows = $newWPDB->get_results(“you-query-here”); On WordPress Multisite: Does having WordPress MultiSite make things a lot easier or should we stick with single installations? There is the switch_to_blog() function available. You will need to restore_current_blog() after getting your results. Note that … Read more
Store site specific data in regular options. See add_option(), get_option() and so on. Store options for the complete network in a site option. See add_site_option() and related functions. You can add new fields for these options in a separate admin page or use an existing page for that. For the latter see my plugin Public … Read more
You can try this instead of get_last_updated(): global $wpdb; $blogs = $wpdb->get_results(“SELECT blog_id, domain, path FROM {$wpdb->blogs} ORDER BY last_updated DESC” , ARRAY_A ); print_r($blogs); just to see if it changes anything to skip the public, archived, mature, spam , site_id and deleted filters.
As @s_ha_dum mentioned in the comments, building an API or some sort of XML or JSON feed (or leveraging one that’s already there, or installing a plugin on whatever system that is, etc) is really your only way of getting at that data remotely. Once you get that going, you can use wp_remote_get to query … Read more
You need the wp_network_dashboard_setup action instead of wp_dashboard_setup