Make WordPress Core

Changeset 56249


Ignore:
Timestamp:
07/17/2023 02:48:48 PM (10 months ago)
Author:
joemcgill
Message:

General: Rename wp_in_development_mode() to wp_is_development_mode().

This changes the function name for the helper function to check whether the current environment is running with the WP_DEVELOPMENT_MODE constant set to be more consistent with similar functions in core, like wp_is_maintenance_mode() and wp_is_recover_mode().

Props flixos90, swissspidy, costdev, peterwilson, robinwpdeveloper, SergeyBiryukov, joemcgill.
See 57487.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/index.php

    r56223 r56249  
    4545     * the core developer's workflow.
    4646     */
    47     if ( ! wp_in_development_mode( 'core' ) ) {
     47    if ( ! wp_is_development_mode( 'core' ) ) {
    4848        $transient_name = 'wp_core_block_css_files';
    4949        $files          = get_transient( $transient_name );
  • trunk/src/wp-includes/deprecated.php

    r56226 r56249  
    52355235     * developer's workflow.
    52365236     */
    5237     $can_use_cached = ! wp_in_development_mode( 'theme' );
     5237    $can_use_cached = ! wp_is_development_mode( 'theme' );
    52385238    $cache_group    = 'theme_json';
    52395239    $cache_key      = 'wp_get_global_styles_svg_filters';
  • trunk/src/wp-includes/global-styles-and-settings.php

    r56223 r56249  
    7070     * developer's workflow.
    7171     */
    72     $can_use_cached = ! wp_in_development_mode( 'theme' );
     72    $can_use_cached = ! wp_is_development_mode( 'theme' );
    7373
    7474    $settings = false;
     
    153153     * developer's workflow.
    154154     */
    155     $can_use_cached = empty( $types ) && ! wp_in_development_mode( 'theme' );
     155    $can_use_cached = empty( $types ) && ! wp_is_development_mode( 'theme' );
    156156
    157157    /*
     
    252252     * developer's workflow.
    253253     */
    254     $can_use_cached = ! wp_in_development_mode( 'theme' );
     254    $can_use_cached = ! wp_is_development_mode( 'theme' );
    255255
    256256    /*
     
    361361         * the theme developer's workflow.
    362362         */
    363         ! wp_in_development_mode( 'theme' )
     363        ! wp_is_development_mode( 'theme' )
    364364    ) {
    365365        return $theme_has_support[ $stylesheet ];
  • trunk/src/wp-includes/load.php

    r56245 r56249  
    281281 *
    282282 * This function retrieves the currently set development mode value. To check whether
    283  * a specific development mode is enabled, use wp_in_development_mode().
     283 * a specific development mode is enabled, use wp_is_development_mode().
    284284 *
    285285 * @since 6.3.0
     
    326326 * @return bool True if the given mode is covered by the current development mode, false otherwise.
    327327 */
    328 function wp_in_development_mode( $mode ) {
     328function wp_is_development_mode( $mode ) {
    329329    $current_mode = wp_get_development_mode();
    330330    if ( empty( $current_mode ) ) {
  • trunk/tests/phpunit/tests/load/wpGetDevelopmentMode.php

    r56223 r56249  
    99 * @group load.php
    1010 * @covers ::wp_get_development_mode
    11  * @covers ::wp_in_development_mode
     11 * @covers ::wp_is_development_mode
    1212 */
    1313class Test_WP_Get_Development_Mode extends WP_UnitTestCase {
     
    4747
    4848    /**
    49      * Tests that `wp_in_development_mode()` returns expected results.
     49     * Tests that `wp_is_development_mode()` returns expected results.
    5050     *
    5151     * @ticket 57487
    52      * @dataProvider data_wp_in_development_mode
     52     * @dataProvider data_wp_is_development_mode
    5353     */
    54     public function test_wp_in_development_mode( $current, $given, $expected ) {
     54    public function test_wp_is_development_mode( $current, $given, $expected ) {
    5555        global $_wp_tests_development_mode;
    5656
     
    5858
    5959        if ( $expected ) {
    60             $this->assertTrue( wp_in_development_mode( $given ), "{$given} is expected to pass in {$current} mode" );
     60            $this->assertTrue( wp_is_development_mode( $given ), "{$given} is expected to pass in {$current} mode" );
    6161        } else {
    62             $this->assertFalse( wp_in_development_mode( $given ), "{$given} is expected to fail in {$current} mode" );
     62            $this->assertFalse( wp_is_development_mode( $given ), "{$given} is expected to fail in {$current} mode" );
    6363        }
    6464    }
    6565
    6666    /**
    67      * Data provider that returns test scenarios for the `test_wp_in_development_mode()` method.
     67     * Data provider that returns test scenarios for the `test_wp_is_development_mode()` method.
    6868     *
    6969     * @return array[]
    7070     */
    71     public function data_wp_in_development_mode() {
     71    public function data_wp_is_development_mode() {
    7272        return array(
    7373            'core mode, testing for core'              => array(
Note: See TracChangeset for help on using the changeset viewer.