Changeset 44132 for trunk/src/wp-admin/includes/template.php
- Timestamp:
- 12/14/2018 01:17:57 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-admin/includes/template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43779
- Property svn:mergeinfo changed
-
trunk/src/wp-admin/includes/template.php
r43976 r44132 1137 1137 continue; 1138 1138 } 1139 1140 // Don't show boxes in the block editor, if they're just here for back compat. 1141 if ( $screen->is_block_editor() && isset( $box['args']['__back_compat_meta_box'] ) && $box['args']['__back_compat_meta_box'] ) { 1142 continue; 1143 } 1144 1145 // Don't show boxes in the block editor that aren't compatible with the block editor. 1146 if ( $screen->is_block_editor() && isset( $box['args']['__block_editor_compatible_meta_box'] ) && ! $box['args']['__block_editor_compatible_meta_box'] ) { 1147 continue; 1148 } 1149 1150 $block_compatible = true; 1151 if ( isset( $box['args']['__block_editor_compatible_meta_box'] ) ) { 1152 $block_compatible = (bool) $box['args']['__block_editor_compatible_meta_box']; 1153 unset( $box['args']['__block_editor_compatible_meta_box'] ); 1154 } 1155 1156 if ( isset( $box['args']['__back_compat_meta_box'] ) ) { 1157 $block_compatible |= (bool) $box['args']['__back_compat_meta_box']; 1158 unset( $box['args']['__back_compat_meta_box'] ); 1159 } 1160 1139 1161 $i++; 1140 1162 $hidden_class = in_array( $box['id'], $hidden ) ? ' hide-if-js' : ''; … … 1162 1184 echo "</h2>\n"; 1163 1185 echo '<div class="inside">' . "\n"; 1186 1187 if ( WP_DEBUG && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) { 1188 if ( is_array( $box['callback'] ) ) { 1189 $reflection = new ReflectionMethod( $box['callback'][0], $box['callback'][1] ); 1190 } else { 1191 $reflection = new ReflectionFunction( $box['callback'] ); 1192 } 1193 1194 // Don't show an error if it's an internal PHP function. 1195 if ( ! $reflection->isInternal() ) { 1196 1197 // Only show errors if the meta box was registered by a plugin. 1198 $filename = $reflection->getFileName(); 1199 if ( strpos( $filename, WP_PLUGIN_DIR ) === 0 ) { 1200 $filename = str_replace( WP_PLUGIN_DIR, '', $filename ); 1201 $filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename ); 1202 1203 $plugins = get_plugins(); 1204 foreach ( $plugins as $name => $plugin ) { 1205 if ( strpos( $name, $filename ) === 0 ) { 1206 ?> 1207 <div class="error inline"> 1208 <p> 1209 <?php 1210 /* translators: %s: the name of the plugin that generated this meta box. */ 1211 printf( __( "This meta box, from the %s plugin, isn't compatible with the block editor." ), "<strong>{$plugin['Name']}</strong>" ); 1212 ?> 1213 </p> 1214 </div> 1215 <?php 1216 } 1217 } 1218 } 1219 } 1220 } 1221 1164 1222 call_user_func( $box['callback'], $object, $box ); 1165 1223 echo "</div>\n";
Note: See TracChangeset
for help on using the changeset viewer.