WordPress.org

Make WordPress Core

Changeset 43830


Ignore:
Timestamp:
10/26/2018 08:10:18 AM (13 months ago)
Author:
pento
Message:

Meta Boxes: Fix error when a meta box is rendered with a static method callback.

When WP_DEBUG is set, ensure that a static method callback is passed to ReflectionMethod, instead of ReflectionFunction.

Props DrewAPicture.
Fixes #45192.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/includes/template.php

    r43779 r43830  
    10971097                        if ( is_array( $box['callback'] ) ) {
    10981098                            $reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] );
     1099                        } elseif ( false !== strpos( $box['callback'], '::' ) ) {
     1100                            $reflection = new ReflectionMethod( $box['callback'] );
    10991101                        } else {
    11001102                            $reflection = new ReflectionFunction( $box['callback'] );
Note: See TracChangeset for help on using the changeset viewer.