How to map a specific multi-site blog to a folder?
in the domain/ .htaccess file, add this line at the beginning. RewriteEngine On RewriteBase / RewriteRule ^mag/([_0-9a-zA-Z-]+/)?$ /sites/mag/$2 [L]
in the domain/ .htaccess file, add this line at the beginning. RewriteEngine On RewriteBase / RewriteRule ^mag/([_0-9a-zA-Z-]+/)?$ /sites/mag/$2 [L]
Maybe the hook init is to late for the class and method go(), the update functions run earlier? The hooks muplugins_loaded and update_option start before the init. I have not test your code, is only a hint, not a solution. Maybe also helpfull a analyse of the hook order in the screenshot, create via plugin.
WordPress multisite’s “Upload Path” should be set to a server-relative path (e.g. /home/serveraccountname/public_html/wp-content/uploads). The “Upload URL Path” should be the URI (e.g. http://example.com/wp-content/uploads). Ignore the /sites/1/ fragment for sub-sites – WordPress will add these automatically.
Thanks to @Sorin for posting the trac. From there I found a solution using just filters in functions.php (so no editing the core) Thanks @mensmaximus for posting there: Link: https://core.trac.wordpress.org/ticket/33887#comment:3 <?php add_filter( ‘network_admin_url’, ‘mmx_network_admin_url’, 1, 2 ); function mmx_network_admin_url( $url, $path ){ $url = “https://my_master_domain/wp-admin/network/” . $path; return $url; } add_filter( ‘admin_url’, ‘mmx_admin_url’, 1, 3 … Read more
If you look at the source code of the ‘Add New Site’ page, you can see that WordPress does not provide a hook for this purpose. Of course, it would be possible to add a hook yourself, but it is generally bad practice to edit the WordPress core. However, once submitted and all information is … Read more
Found the answer, posting the code below so it may help future generations. <?php global $wpdb; $count_terms = $wpdb->get_var (“SELECT COUNT(*) FROM wp_2_term_taxonomy, wp_2_posts, wp_2_term_relationships WHERE wp_2_posts.ID = wp_2_term_relationships.object_id AND wp_2_term_relationships.term_taxonomy_id = wp_2_term_taxonomy.term_taxonomy_id AND wp_2_term_taxonomy.term_id = ’22’ AND wp_2_posts.post_type=”post” AND wp_2_posts.post_status=”publish” “); $count_terms1 = $wpdb->get_var (“SELECT COUNT(*) FROM wp_3_term_taxonomy, wp_3_posts, wp_3_term_relationships WHERE wp_3_posts.ID = wp_3_term_relationships.object_id … Read more
A simple solution is: wp user reset-password $(wp user list –field=user_login) got that from forcing all plugins update after a minor takeover: wp plugin install $(wp plugin list –field=name) –force
More than an answer, a study on the matter. The Excel issue we need an array, and Excel can provide a CSV a couple of solutions: How to extract data from csv file in php? not implemented here Relevant Q&A What’s common to all is: no definitive procedure has been recorded in this Stack. Programmatically … Read more
You’d have to make you site categories slug match your theme categories folder names. Here’s how to filter themes: Hide a theme on list of themes in wp-admin without editing core files And then, supposing a site has the category a-p and the themes are stored in themes/a-p/, this will filter them out: add_filter( ‘all_themes’, … Read more
When you’re adding the wildcard subdomain, you need to make sure it is registered last in your ANAME records. Then make sure all of the static subdomains (webmail.domainname.com, cpanel.domainname.com, etc) appear before it. When using wildcard subdomains, the server starts at the top of the list and works its way down. If all you have … Read more