<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[56223] trunk: General: Introduce `all` development mode.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/56223">56223</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/56223","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>peterwilsoncc</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-07-13 00:27:06 +0000 (Thu, 13 Jul 2023)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>General: Introduce `all` development mode.

Introduce the development mode `all` as a a cover-all mode for the existing `theme`, `plugin` and `core` development modes. Developers can use the `all` mode if they are developing both themes and plugins, for example.

Introduce the utility function `wp_in_development_mode()` allowing developers to detect the mode via a parameter. If the development mode is set to `all` this function will always return `true`. If the development mode is specific then only the chosen mode will return `true`.

Follow up to [56079,56042].

Props flixos90.
Fixes <a href="https://core.trac.wordpress.org/ticket/57487">#57487</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesblocksindexphp">trunk/src/wp-includes/blocks/index.php</a></li>
<li><a href="#trunksrcwpincludesdefaultconstantsphp">trunk/src/wp-includes/default-constants.php</a></li>
<li><a href="#trunksrcwpincludesdeprecatedphp">trunk/src/wp-includes/deprecated.php</a></li>
<li><a href="#trunksrcwpincludesglobalstylesandsettingsphp">trunk/src/wp-includes/global-styles-and-settings.php</a></li>
<li><a href="#trunksrcwpincludesloadphp">trunk/src/wp-includes/load.php</a></li>
<li><a href="#trunktestsphpunittestsloadwpGetDevelopmentModephp">trunk/tests/phpunit/tests/load/wpGetDevelopmentMode.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesblocksindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/blocks/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/blocks/index.php    2023-07-12 20:59:37 UTC (rev 56222)
+++ trunk/src/wp-includes/blocks/index.php      2023-07-13 00:27:06 UTC (rev 56223)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * Ignore transient cache when the development mode is set to 'core'. Why? To avoid interfering with
</span><span class="cx" style="display: block; padding: 0 10px">         * the core developer's workflow.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( 'core' !== wp_get_development_mode() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! wp_in_development_mode( 'core' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $transient_name = 'wp_core_block_css_files';
</span><span class="cx" style="display: block; padding: 0 10px">                $files          = get_transient( $transient_name );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! $files ) {
</span></span></pre></div>
<a id="trunksrcwpincludesdefaultconstantsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/default-constants.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/default-constants.php       2023-07-12 20:59:37 UTC (rev 56222)
+++ trunk/src/wp-includes/default-constants.php 2023-07-13 00:27:06 UTC (rev 56223)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,8 +79,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /*
</span><span class="cx" style="display: block; padding: 0 10px">         * Add define( 'WP_DEVELOPMENT_MODE', 'core' ) or define( 'WP_DEVELOPMENT_MODE', 'plugin' ) or
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * define( 'WP_DEVELOPMENT_MODE', 'theme' ) to wp-config.php to signify development mode for WordPress core, a
-        * plugin, or a theme respectively.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * define( 'WP_DEVELOPMENT_MODE', 'theme' ) or define( 'WP_DEVELOPMENT_MODE', 'all' ) to wp-config.php
+        * to signify development mode for WordPress core, a plugin, a theme, or all three types respectively.
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        if ( ! defined( 'WP_DEVELOPMENT_MODE' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                define( 'WP_DEVELOPMENT_MODE', '' );
</span></span></pre></div>
<a id="trunksrcwpincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/deprecated.php      2023-07-12 20:59:37 UTC (rev 56222)
+++ trunk/src/wp-includes/deprecated.php        2023-07-13 00:27:06 UTC (rev 56223)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5233,7 +5233,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme
</span><span class="cx" style="display: block; padding: 0 10px">         * developer's workflow.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $can_use_cached = wp_get_development_mode() !== 'theme';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $can_use_cached = ! wp_in_development_mode( 'theme' );
</ins><span class="cx" style="display: block; padding: 0 10px">         $cache_group    = 'theme_json';
</span><span class="cx" style="display: block; padding: 0 10px">        $cache_key      = 'wp_get_global_styles_svg_filters';
</span><span class="cx" style="display: block; padding: 0 10px">        if ( $can_use_cached ) {
</span></span></pre></div>
<a id="trunksrcwpincludesglobalstylesandsettingsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/global-styles-and-settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/global-styles-and-settings.php      2023-07-12 20:59:37 UTC (rev 56222)
+++ trunk/src/wp-includes/global-styles-and-settings.php        2023-07-13 00:27:06 UTC (rev 56223)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme
</span><span class="cx" style="display: block; padding: 0 10px">         * developer's workflow.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $can_use_cached = wp_get_development_mode() !== 'theme';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $can_use_cached = ! wp_in_development_mode( 'theme' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $settings = false;
</span><span class="cx" style="display: block; padding: 0 10px">        if ( $can_use_cached ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,7 +152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme
</span><span class="cx" style="display: block; padding: 0 10px">         * developer's workflow.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $can_use_cached = empty( $types ) && wp_get_development_mode() !== 'theme';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $can_use_cached = empty( $types ) && ! wp_in_development_mode( 'theme' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /*
</span><span class="cx" style="display: block; padding: 0 10px">         * By using the 'theme_json' group, this data is marked to be non-persistent across requests.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,7 +251,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * Ignore cache when the development mode is set to 'theme', so it doesn't interfere with the theme
</span><span class="cx" style="display: block; padding: 0 10px">         * developer's workflow.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $can_use_cached = wp_get_development_mode() !== 'theme';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $can_use_cached = ! wp_in_development_mode( 'theme' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /*
</span><span class="cx" style="display: block; padding: 0 10px">         * By using the 'theme_json' group, this data is marked to be non-persistent across requests.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -360,7 +360,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * Ignore static cache when the development mode is set to 'theme', to avoid interfering with
</span><span class="cx" style="display: block; padding: 0 10px">                 * the theme developer's workflow.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                wp_get_development_mode() !== 'theme'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         ! wp_in_development_mode( 'theme' )
</ins><span class="cx" style="display: block; padding: 0 10px">         ) {
</span><span class="cx" style="display: block; padding: 0 10px">                return $theme_has_support[ $stylesheet ];
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="trunksrcwpincludesloadphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/load.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/load.php    2023-07-12 20:59:37 UTC (rev 56222)
+++ trunk/src/wp-includes/load.php      2023-07-13 00:27:06 UTC (rev 56223)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,11 +271,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * The development mode affects how certain parts of the WordPress application behave, which is relevant when
</span><span class="cx" style="display: block; padding: 0 10px">  * developing for WordPress.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Valid developer modes are 'core', 'plugin', 'theme', or an empty string to disable developer mode.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Valid development modes are 'core', 'plugin', 'theme', 'all', or an empty string to disable development mode.
+ * 'all' is a special value to signify that all three development modes 'core', 'plugin', and 'theme' are enabled.
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Developer mode is considered separately from `WP_DEBUG` and {@see wp_get_environment_type()}. It does not affect
</span><span class="cx" style="display: block; padding: 0 10px">  * debugging output, but rather functional nuances in WordPress.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * This function controls the currently set development mode value. To check for whether a specific development mode is
+ * enabled, use wp_in_development_mode().
+ *
</ins><span class="cx" style="display: block; padding: 0 10px">  * @since 6.3.0
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @return string The current development mode.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,6 +302,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'core',
</span><span class="cx" style="display: block; padding: 0 10px">                'plugin',
</span><span class="cx" style="display: block; padding: 0 10px">                'theme',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'all',
</ins><span class="cx" style="display: block; padding: 0 10px">                 '',
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px">        if ( ! in_array( $development_mode, $valid_modes, true ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,6 +315,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Checks whether the site is in the given development mode.
+ *
+ * @since 6.3.0
+ *
+ * @param string $mode Development mode to check for. Either 'core', 'plugin', 'theme', or 'all'.
+ * @return bool True if the given mode is covered by the current development mode, false otherwise.
+ */
+function wp_in_development_mode( $mode ) {
+       $current_mode = wp_get_development_mode();
+       if ( empty( $current_mode ) ) {
+               return false;
+       }
+
+       // Return true if the current mode encompasses all modes.
+       if ( 'all' === $current_mode ) {
+               return true;
+       }
+
+       // Return true if the current mode is the given mode.
+       return $mode === $current_mode;
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Ensures all of WordPress is not loaded when handling a favicon.ico request.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * Instead, send the headers for a zero-length favicon and bail.
</span></span></pre></div>
<a id="trunktestsphpunittestsloadwpGetDevelopmentModephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/load/wpGetDevelopmentMode.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/load/wpGetDevelopmentMode.php   2023-07-12 20:59:37 UTC (rev 56222)
+++ trunk/tests/phpunit/tests/load/wpGetDevelopmentMode.php     2023-07-13 00:27:06 UTC (rev 56223)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,6 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @group load.php
</span><span class="cx" style="display: block; padding: 0 10px">  * @covers ::wp_get_development_mode
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @covers ::wp_in_development_mode
</ins><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> class Test_WP_Get_Development_Mode extends WP_UnitTestCase {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,4 +44,117 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $_wp_tests_development_mode = 'invalid';
</span><span class="cx" style="display: block; padding: 0 10px">                $this->assertSame( '', wp_get_development_mode() );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       /**
+        * Tests that `wp_in_development_mode()` returns expected results.
+        *
+        * @ticket 57487
+        * @dataProvider data_wp_in_development_mode
+        */
+       public function test_wp_in_development_mode( $current, $given, $expected ) {
+               global $_wp_tests_development_mode;
+
+               $_wp_tests_development_mode = $current;
+
+               if ( $expected ) {
+                       $this->assertTrue( wp_in_development_mode( $given ), "{$given} is expected to pass in {$current} mode" );
+               } else {
+                       $this->assertFalse( wp_in_development_mode( $given ), "{$given} is expected to fail in {$current} mode" );
+               }
+       }
+
+       /**
+        * Data provider that returns test scenarios for the `test_wp_in_development_mode()` method.
+        *
+        * @return array[]
+        */
+       public function data_wp_in_development_mode() {
+               return array(
+                       'core mode, testing for core'              => array(
+                               'core',
+                               'core',
+                               true,
+                       ),
+                       'plugin mode, testing for plugin'          => array(
+                               'plugin',
+                               'plugin',
+                               true,
+                       ),
+                       'theme mode, testing for theme'            => array(
+                               'theme',
+                               'theme',
+                               true,
+                       ),
+                       'core mode, testing for plugin'            => array(
+                               'core',
+                               'plugin',
+                               false,
+                       ),
+                       'core mode, testing for theme'             => array(
+                               'core',
+                               'theme',
+                               false,
+                       ),
+                       'plugin mode, testing for core'            => array(
+                               'plugin',
+                               'core',
+                               false,
+                       ),
+                       'plugin mode, testing for theme'           => array(
+                               'plugin',
+                               'theme',
+                               false,
+                       ),
+                       'theme mode, testing for core'             => array(
+                               'theme',
+                               'core',
+                               false,
+                       ),
+                       'theme mode, testing for plugin'           => array(
+                               'theme',
+                               'plugin',
+                               false,
+                       ),
+                       'all mode, testing for core'               => array(
+                               'all',
+                               'core',
+                               true,
+                       ),
+                       'all mode, testing for plugin'             => array(
+                               'all',
+                               'plugin',
+                               true,
+                       ),
+                       'all mode, testing for theme'              => array(
+                               'all',
+                               'theme',
+                               true,
+                       ),
+                       'all mode, testing for all'                => array(
+                               'all',
+                               'all',
+                               true,
+                       ),
+                       'all mode, testing for non-standard value' => array(
+                               'all',
+                               'random',
+                               true,
+                       ),
+                       'invalid mode, testing for core'           => array(
+                               'invalid',
+                               'core',
+                               false,
+                       ),
+                       'invalid mode, testing for plugin'         => array(
+                               'invalid',
+                               'plugin',
+                               false,
+                       ),
+                       'invalid mode, testing for theme'          => array(
+                               'invalid',
+                               'theme',
+                               false,
+                       ),
+               );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>

</body>
</html>