Make WordPress Core

Changeset 36801


Ignore:
Timestamp:
03/02/2016 06:08:38 AM (9 years ago)
Author:
westonruter
Message:

Customize: Define params on WP_Customize_Partial::render_callback() for the sake of subclasses overriding this method.

Fixes a strict standards notice regarding the method signature needing to be compatible.

See #27355.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-partial.php

    r36689 r36801  
    273273     * @access public
    274274     *
     275     * @param WP_Customize_Partial $partial Partial.
     276     * @param array                $context Context.
    275277     * @return string|array|false
    276278     */
    277     public function render_callback() {
     279    public function render_callback( WP_Customize_Partial $partial, $context = array() ) {
     280        unset( $partial, $context );
    278281        return false;
    279282    }
  • trunk/tests/phpunit/tests/customize/partial.php

    r36784 r36801  
    269269    function test_render_callback_default() {
    270270        $partial = new WP_Customize_Partial( $this->selective_refresh, 'foo' );
    271         $this->assertFalse( $partial->render_callback() );
    272         $this->assertFalse( call_user_func( $partial->render_callback ) );
     271        $this->assertFalse( $partial->render_callback( $partial, array() ) );
     272        $this->assertFalse( call_user_func( $partial->render_callback, $partial, array() ) );
    273273    }
    274274
Note: See TracChangeset for help on using the changeset viewer.