WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/17/2016 05:10:53 PM (5 years ago)
Author:
ocean90
Message:

Script/Style Dependencies: Make sure that inline styles for handles without a source are printed.

This prevents breaking plugins which are adding inline styles to the wp-admin handle after [36341].

Props dd32, ocean90.
Fixes #35229.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r36549 r36550  
    167167    }
    168168
     169    /**
     170     * @ticket 35229
     171     */
     172    function test_wp_register_script_with_handle_without_source() {
     173        $expected  = "<script type='text/javascript' src='http://example.com?ver=1'></script>\n";
     174        $expected .= "<script type='text/javascript' src='http://example.com?ver=2'></script>\n";
     175
     176        wp_register_script( 'handle-one', 'http://example.com', array(), 1 );
     177        wp_register_script( 'handle-two', 'http://example.com', array(), 2 );
     178        wp_register_script( 'handle-three', false, array( 'handle-one', 'handle-two' ) );
     179
     180        wp_enqueue_script( 'handle-three' );
     181
     182        $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
     183    }
     184
    169185}
Note: See TracChangeset for help on using the changeset viewer.