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. Built from https://develop.svn.wordpress.org/branches/5.0@43830 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e491b2bc6a
commit
0c54153886
|
@ -1096,6 +1096,8 @@ function do_meta_boxes( $screen, $context, $object ) {
|
||||||
if ( WP_DEBUG && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) {
|
if ( WP_DEBUG && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) {
|
||||||
if ( is_array( $box['callback'] ) ) {
|
if ( is_array( $box['callback'] ) ) {
|
||||||
$reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] );
|
$reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] );
|
||||||
|
} elseif ( false !== strpos( $box['callback'], '::' ) ) {
|
||||||
|
$reflection = new ReflectionMethod( $box['callback'] );
|
||||||
} else {
|
} else {
|
||||||
$reflection = new ReflectionFunction( $box['callback'] );
|
$reflection = new ReflectionFunction( $box['callback'] );
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-beta1-43829';
|
$wp_version = '5.0-beta1-43830';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue