Make WordPress Core

Ticket #14541: 14541.dff

File 14541.dff, 1.0 KB (added by spmlucas, 13 years ago)
Line 
1Index: template.php
2===================================================================
3--- template.php (revision 27070)
4+++ template.php (working copy)
5@@ -943,6 +943,7 @@
6 * @param string $id String for use in the 'id' attribute of tags.
7 * @param string|object $screen The screen on which to show the box (post, page, link).
8 * @param string $context The context within the page where the boxes should show ('normal', 'advanced').
9+ * @return boolean False on failure, true on success.
10 */
11 function remove_meta_box($id, $screen, $context) {
12 global $wp_meta_boxes;
13@@ -961,8 +962,14 @@
14 if ( !isset($wp_meta_boxes[$page][$context]) )
15 $wp_meta_boxes[$page][$context] = array();
16
17- foreach ( array('high', 'core', 'default', 'low') as $priority )
18- $wp_meta_boxes[$page][$context][$priority][$id] = false;
19+ foreach ( array('high', 'core', 'default', 'low') as $priority ) {
20+ if ( isset($wp_meta_boxes[$page][$context][$priority][$id]) ) {
21+ $wp_meta_boxes[$page][$context][$priority][$id] = false;
22+ return true;
23+ }
24+ }
25+
26+ return false;
27 }
28
29 /**