Changeset 43779 for branches/5.0/src/wp-admin/includes/template.php
- Timestamp:
- 10/22/2018 02:31:38 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-admin/includes/template.php
r43496 r43779 1052 1052 if ( false == $box || ! $box['title'] ) 1053 1053 continue; 1054 1055 // Don't show boxes in the block editor, if they're just here for back compat. 1056 if ( $screen->is_block_editor() && isset( $box['args']['__back_compat_meta_box'] ) && $box['args']['__back_compat_meta_box'] ) { 1057 continue; 1058 } 1059 1060 // Don't show boxes in the block editor that aren't compatible with the block editor. 1061 if ( $screen->is_block_editor() && isset( $box['args']['__block_editor_compatible_meta_box'] ) && ! $box['args']['__block_editor_compatible_meta_box'] ) { 1062 continue; 1063 } 1064 1065 $block_compatible = true; 1066 if ( isset( $box['args']['__block_editor_compatible_meta_box'] ) ) { 1067 $block_compatible = (bool) $box['args']['__block_editor_compatible_meta_box']; 1068 unset( $box['args']['__block_editor_compatible_meta_box'] ); 1069 } 1070 1071 if ( isset( $box['args']['__back_compat_meta_box'] ) ) { 1072 $block_compatible |= (bool) $box['args']['__back_compat_meta_box']; 1073 unset( $box['args']['__back_compat_meta_box'] ); 1074 } 1075 1054 1076 $i++; 1055 1077 $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : ''; … … 1071 1093 echo "<h2 class='hndle'><span>{$box['title']}</span></h2>\n"; 1072 1094 echo '<div class="inside">' . "\n"; 1095 1096 if ( WP_DEBUG && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) { 1097 if ( is_array( $box['callback'] ) ) { 1098 $reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] ); 1099 } else { 1100 $reflection = new ReflectionFunction( $box['callback'] ); 1101 } 1102 1103 // Don't show an error if it's an internal PHP function. 1104 if ( ! $reflection->isInternal() ) { 1105 1106 // Only show errors if the meta box was registered by a plugin. 1107 $filename = $reflection->getFileName(); 1108 if ( strpos( $filename, WP_PLUGIN_DIR ) === 0 ) { 1109 $filename = str_replace( WP_PLUGIN_DIR, '', $filename ); 1110 $filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename ); 1111 1112 $plugins = get_plugins(); 1113 foreach ( $plugins as $name => $plugin ) { 1114 if ( strpos( $name, $filename ) === 0 ) { 1115 ?> 1116 <div class="error inline"> 1117 <p> 1118 <?php 1119 /* translators: %s: the name of the plugin that generated this meta box. */ 1120 printf( __( "This meta box, from the %s plugin, isn't compatible with the block editor." ), "<strong>{$plugin['Name']}</strong>" ); 1121 ?> 1122 </p> 1123 </div> 1124 <?php 1125 } 1126 } 1127 } 1128 } 1129 } 1130 1073 1131 call_user_func($box['callback'], $object, $box); 1074 1132 echo "</div>\n";
Note: See TracChangeset
for help on using the changeset viewer.