Make WordPress Core

Changeset 44170


Ignore:
Timestamp:
12/14/2018 05:54:34 AM (6 years 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.

Merges [43830] from the 5.0 branch to trunk.

Props DrewAPicture.
Fixes #45192.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/template.php

    r44132 r44170  
    11881188                        if ( is_array( $box['callback'] ) ) {
    11891189                            $reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] );
     1190                        } elseif ( false !== strpos( $box['callback'], '::' ) ) {
     1191                            $reflection = new ReflectionMethod( $box['callback'] );
    11901192                        } else {
    11911193                            $reflection = new ReflectionFunction( $box['callback'] );
Note: See TracChangeset for help on using the changeset viewer.