[wp-trac] [WordPress Trac] #24138: Add Constant control for Multisite.

WordPress Trac noreply at wordpress.org
Fri Jan 8 22:54:32 UTC 2016


#24138: Add Constant control for Multisite.
-------------------------+-------------------------
 Reporter:  krembo99     |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Multisite    |     Version:
 Severity:  normal       |  Resolution:  maybelater
 Keywords:               |     Focuses:
-------------------------+-------------------------

Comment (by mkormendy):

 I know this ticket is a tad old, but the following sample code is one
 proposed solution that I place at the end of my wp-config file that works
 nicely. In my case I wanted to define which sites were live and which were
 in development, but it can be easily modified for any site-specific
 purpose:

 {{{#!php
 /**
  * Development Environment Constant.
  *
  * If this is a development environment, this will turn on certain
 debugging codes I have in my
  * theme and plugin files that I use for identifying which code blocks are
 in which files.
  *
  * Remove the blog_id comparison for sites on production environment.
  */

 $blog_id = get_current_blog_id();
 if ( $blog_id == 5 || $blog_id == 14 ) {
   define('ENV', 'dev');
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24138#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list