If you are implementing a global functionality for your entire multisite/sub-sites like what you describe, you should implement this as mu-plugins instead adding the cuztomization inside a theme file, just create a file like in wp-content/mu-plugins/GlobalConfig.php
which holds the customization you want and will take effect globally, unless you want this customization for only specific sub-site.
the init
runs before the wp_loaded
, but you can intercept the request at plugins_loaded hook since it runs even before init
e.i.
add_action('plugins_loaded', function() {
//skip wp back-end request
if ( is_admin() )
return;
$isDeleted = get_blog_option(get_current_blog_id(), 'deleted');
if ( $isDeleted )
exit( wp_redirect( 'https://site2.com/sub-page', 301 ) );
});
Related Posts:
- Hook filter to change wp_upload_dir() path in multisite
- WordPress 3.2(Multisite) – How to add custom user meta fields to signup form?
- Limit entries number on network/sites.php
- Cannot use pre_set_site_transient_update_themes from within a theme in multisite
- Conditional Image Sizes for Use via Theme Customizer Upload Only
- Shared upload folder in wordpress multisite with custom sub site domain pictures URL:s
- Do “switch_to_blog()” and “restore_current_blog()” re-run the filters?
- How to disable style filtering in post?
- The wpmu_blogs_columns filter is not working
- How to use WordPress Multisite With Different Domain Names?
- Can i merge 2 new WP_Query($variable) ‘s?
- How to reliably flush rewrite rules on multisite?
- Using wp_insert_post() with Networking enabled
- Sharing Dynamic Sidebars across Multisite Blogs
- multisite: use a virtual subfolder for subblogs
- WP Multisite – multilanguage – swich to other language by click, but “same” content
- How To Provide Sub-Blogs Their Own Domain Names?
- “You need a higher level of permission” after admin changing. Why?
- Advanced Custom Fields Multisite Upload/Imagery Issue [closed]
- Prevent user creating new users with specific roles
- What is the correct form action URL for network options pages?
- Lock one of WP Network sites for not registered users
- How can I manage all multisite pending comments in one place?
- WordPress Multisite Network installation and dev questions
- BuddyPress on Multisite [closed]
- List all sites in multisite
- Migrating WPMS from apache to IIS7 causes Database Error
- Turn off trackback/pingbacks and comments on all existing multisite sites
- Subfolder multisite issue. Themes and plugin files 404
- Creating Admin Options Page where users can make changes to a theme
- htmll lang=”de” but admin page in English
- Multisite list all pages in site
- WordPress Multisite Sites show in Dropdown but not in Sites menu
- Dissolve Multisite while making site #5 the main site?
- Disable domain redirect
- Multisite setup on IIS with subdomains
- Partially translated dashboard in one of network’s site
- How can I fix a Virtual Multiblog install that has no errors, but won’t show all my sites?
- Disabling outbound connectivity on web servers [closed]
- Depth > 2 possible with multisite?
- What are Attributes used for in a WordPress Multisite?
- Make a user administrator to a sub directory site and a contributor to main site in multisite network
- How to store custom user data on the database?
- NGINX rewrite rules for sub subdomains
- Temp URL Redirect Loop
- wordpress multisite dashboard link in admin bar
- Multisite – user email activation links broken
- Multisite with subfolders- can’t access main site- Error establishing a database connection
- WP MU Register User across all blogs
- multisite subdomain behind reverse proxy
- Set default settings for all new multisites?
- How to disable a network enabled plugin on all sites, excepting on one?
- Multisite Subdirectory with same domain subdomain
- wp_mail() not sending email in multisite subdomain
- What are good approaches to routing some urls to a second WordPress install?
- Show media-frame-menu on custom Media Frame
- Show content of other domain inside WordPress
- Moving a remote WordPress multisite installation to local
- Multisite redirecting wrong when without WWW
- Multisite, domain mapping and SSL?
- Google Apps SMTP for WP MultiSite?
- Get users registered 30 days ago(or more)
- Pull Custom /wp-admin/css for Non-Admin in Multisite
- Being Forced To Use Sub-Domains on Multisite
- WordPress in subdirectory, Multisite using subdomains Nginx
- Is WordPress cache shared for all blogs in a multisite network?
- Display Selected themes to user in admin for wordpress multisite
- White blank page when Updating/Draft/Publishing Page/Post
- The Events Calendar: Events page as Home page [closed]
- Multisite wp-admin goes to blank screen after forwarding URL
- How to redirect user after session timeout
- WPMU If MU site has no administrator, deactivate site
- Choosing the right kind of hosting for a WordPress multisite
- Moving wordpress multi to different domain and vhost – cannot log in and menu problems
- Multisite ad server solution
- How can I run multiple unique WordPress sites off of one VPS
- Function to Load Admin CSS for Super Admin on Multisite
- Multisite Configurations
- How to update wordpress content of wordpress multi-site subdomain
- How to post same content on multisite?
- Created child theme from Themegrill Flash-Pro and the child theme is blank
- Configure redirects with web.config
- Events Calendar Multisite 404 for events
- WordPress Database Cleanup
- Multisite – How sync posts to multi sites
- Multiple Languages for each subsite on a Multisite
- Optimal setup for Multi Domain WordPress with Woocommerce
- Whats the best Practice for using a different Theme for WebView Apps?
- Current blog is returning ID of 1 instead of users blog ID?
- Blog switch wpml string translation (multi-site)
- Multilingual multisite > customisable footer across different sites with widgets?
- Manually insert post into MULTISITE database: Need to specify the TABLE
- Transfer Part of Multisite to new Domain
- Crop image sizes directly from Media Library across network (not attached to post or page but sidebar)
- Is there any way to give all users access to one blog in a multisite network without using a plugin?
- WPMU Domain not pinging
- In a loop, do not display content that does not have a thumbnail
- How to use same email for multiple users? [duplicate]
- How do I set up multisite on Digitalocean?
- WordPress multisite broken after network update?