Make WordPress Core


Ignore:
Timestamp:
08/13/2017 05:24:14 AM (8 years ago)
Author:
westonruter
Message:

Widgets: Fix extensibility of Text widgets so that JS logic will initialize on subclassed widgets.

Amends [40631].
See #35243.
Fixes #41540.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/widgets/text-widget.php

    r41134 r41245  
    6565
    6666        $this->assertEquals( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
    67         $this->assertEquals( 10, has_action( 'admin_footer-widgets.php', array( $widget, 'render_control_template_scripts' ) ) );
     67        $this->assertEquals( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) ) );
     68        $this->assertContains( 'wp.textWidgets.idBases.push( "text" );', wp_scripts()->registered['text-widgets']->extra['after'] );
    6869    }
    6970
     
    746747     */
    747748    function test_render_control_template_scripts() {
    748         $widget = new WP_Widget_Text();
    749 
    750         ob_start();
    751         $widget->render_control_template_scripts();
     749        ob_start();
     750        WP_Widget_Text::render_control_template_scripts();
    752751        $output = ob_get_clean();
    753752
Note: See TracChangeset for help on using the changeset viewer.