mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43830 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9cd32b93da
commit
0ba73f24ba
@ -1096,6 +1096,8 @@ function do_meta_boxes( $screen, $context, $object ) {
|
||||
if ( WP_DEBUG && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) {
|
||||
if ( is_array( $box['callback'] ) ) {
|
||||
$reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] );
|
||||
} elseif ( false !== strpos( $box['callback'], '::' ) ) {
|
||||
$reflection = new ReflectionMethod( $box['callback'] );
|
||||
} else {
|
||||
$reflection = new ReflectionFunction( $box['callback'] );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user