mu-plugins and options override
-
I’m trying to use
update_blog_public()to force a site to be public or private.Since I cannot use it in wp-config I put
define('blog_public', '0' );in wp-config
and this snippet in mu-plugins:add_action( 'shutdown', 'MyInit'); function MyInit() { if (defined('blog_public')) { if (constant('blog_public')=='0') { update_blog_public( $old_value, false ); } if (constant('blog_public')=='1') { update_blog_public( $old_value, true ); } } }It is surely runned (I can do fatals) but it doesn’t work.
I chose ‘shutdown’ because most of earlier hooks like ‘wp_loaded’ get me
Call to undefined function update_blog_public()
.
Is there something wickedly evil that I’m tring to do or is it just a minor bug?
My aim is to define whether a wordpress installation is public or private directly in the wp-config, so to be sure that productions are public and developments are private.
Thank you
The topic ‘mu-plugins and options override’ is closed to new replies.