Make WordPress Core


Ignore:
Timestamp:
05/10/2015 07:56:15 PM (10 years ago)
Author:
johnbillion
Message:

Add a return value to wp_register_script() and wp_register_style() which matches the return value of WP_Dependencies::add().

Props katzwebdesign, pareshradadiya, DrewAPicture.

Fixes #31126

File:
1 edited

Legend:

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

    r31317 r32483  
    156156        $this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
    157157    }
     158
     159    /**
     160     * Testing 'wp_register_script' return boolean success/failure value.
     161     *
     162     * @ticket 31126
     163     */
     164    function test_wp_register_script() {
     165        $this->assertTrue( wp_register_script( 'duplicate-handler', 'http://example.com' ) );
     166        $this->assertFalse( wp_register_script( 'duplicate-handler', 'http://example.com' ) );
     167    }
     168
    158169}
Note: See TracChangeset for help on using the changeset viewer.