Skip to content

Commit

Permalink
Protect development mode constant from being re-defined (#14165)
Browse files Browse the repository at this point in the history
When defining `GUTENBERG_DEVELOPMENT_MODE` in `wp-config.php` and running Gutenberg `master` directly from the repository, we'd see PHP warnings:

```
[28-Feb-2019 11:39:14 UTC] PHP Notice:  Constant GUTENBERG_DEVELOPMENT_MODE already defined in /var/www/html/wp-content/plugins/gutenberg/gutenberg.php on line 13
[28-Feb-2019 11:39:14 UTC] PHP Stack trace:
[28-Feb-2019 11:39:14 UTC] PHP   1. {main}() /var/www/html/wp-cron.php:0
[28-Feb-2019 11:39:14 UTC] PHP   2. require_once() /var/www/html/wp-cron.php:39
[28-Feb-2019 11:39:14 UTC] PHP   3. require_once() /var/www/html/wp-load.php:37
[28-Feb-2019 11:39:14 UTC] PHP   4. require_once() /var/www/html/wp-config.php:89
[28-Feb-2019 11:39:14 UTC] PHP   5. include_once() /var/www/html/wp-settings.php:342
[28-Feb-2019 11:39:14 UTC] PHP   6. define() /var/www/html/wp-content/plugins/gutenberg/gutenberg.php:13
```
  • Loading branch information
simison authored and aduth committed Apr 24, 2019
1 parent d5bdd53 commit 65ef499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

### BEGIN AUTO-GENERATED DEFINES
define( 'GUTENBERG_DEVELOPMENT_MODE', true );
defined( 'GUTENBERG_DEVELOPMENT_MODE' ) or define( 'GUTENBERG_DEVELOPMENT_MODE', true );
### END AUTO-GENERATED DEFINES

gutenberg_pre_init();
Expand Down

0 comments on commit 65ef499

Please sign in to comment.