Make WordPress Core


Ignore:
Timestamp:
07/13/2023 12:27:06 AM (19 months ago)
Author:
peterwilsoncc
Message:

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 #57487.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/global-styles-and-settings.php

    r56185 r56223  
    7070     * developer's workflow.
    7171     */
    72     $can_use_cached = wp_get_development_mode() !== 'theme';
     72    $can_use_cached = ! wp_in_development_mode( 'theme' );
    7373
    7474    $settings = false;
     
    153153     * developer's workflow.
    154154     */
    155     $can_use_cached = empty( $types ) && wp_get_development_mode() !== 'theme';
     155    $can_use_cached = empty( $types ) && ! wp_in_development_mode( 'theme' );
    156156
    157157    /*
     
    252252     * developer's workflow.
    253253     */
    254     $can_use_cached = wp_get_development_mode() !== 'theme';
     254    $can_use_cached = ! wp_in_development_mode( 'theme' );
    255255
    256256    /*
     
    361361         * the theme developer's workflow.
    362362         */
    363         wp_get_development_mode() !== 'theme'
     363        ! wp_in_development_mode( 'theme' )
    364364    ) {
    365365        return $theme_has_support[ $stylesheet ];
Note: See TracChangeset for help on using the changeset viewer.