Ticket #15000: 15000.6-refresh.diff
File 15000.6-refresh.diff, 3.1 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/template.php
966 966 * @param string $title Title of the meta box. 967 967 * @param callback $callback Function that fills the box with the desired content. 968 968 * The function should echo its output. 969 * @param string| WP_Screen $screenOptional. The screen on which to show the box (like a post969 * @param string|array|WP_Screen $screen Optional. The screen on which to show the box (like a post 970 970 * type, 'link', or 'comment'). Default is the current screen. 971 * Also accepts an array of post type slugs. 971 972 * @param string $context Optional. The context within the screen where the boxes 972 973 * should display. Available contexts vary from screen to 973 974 * screen. Post edit screen contexts include 'normal', 'side', … … 983 984 function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) { 984 985 global $wp_meta_boxes; 985 986 986 if ( empty( $screen ) ) 987 if ( empty( $screen ) ) { 987 988 $screen = get_current_screen(); 988 elseif ( is_string( $screen ) )989 } elseif ( is_string( $screen ) ) { 989 990 $screen = convert_to_screen( $screen ); 991 } elseif ( is_array( $screen ) ) { 992 foreach ( $screen as $single_screen ) { 993 add_meta_box( $id, $title, $callback, $single_screen, $context, $priority, $callback_args ); 994 } 995 } 990 996 997 if ( ! isset( $screen->id ) ) { 998 return; 999 } 1000 991 1001 $page = $screen->id; 992 1002 993 1003 if ( !isset($wp_meta_boxes) ) … … 1125 1135 * 1126 1136 * @global array $wp_meta_boxes 1127 1137 * 1128 * @param string $id String for use in the 'id' attribute of tags. 1129 * @param string|object $screen The screen on which to show the box (post, page, link). 1130 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 1138 * @param string $id String for use in the 'id' attribute of tags. 1139 * @param string|array|object $screen The screen on which to show the box (post, page, link). Also accepts an 1140 * array of post type slugs from which to remove the box from. 1141 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 1131 1142 */ 1132 function remove_meta_box( $id, $screen, $context) {1143 function remove_meta_box( $id, $screen, $context ) { 1133 1144 global $wp_meta_boxes; 1134 1145 1135 if ( empty( $screen ) ) 1146 if ( empty( $screen ) ) { 1136 1147 $screen = get_current_screen(); 1137 elseif ( is_string( $screen ) )1148 } elseif ( is_string( $screen ) ) { 1138 1149 $screen = convert_to_screen( $screen ); 1150 } elseif ( is_array( $screen ) ) { 1151 foreach ( $screen as $single_screen ) { 1152 remove_meta_box( $id, $single_screen, $context ); 1153 } 1154 } 1139 1155 1156 if ( ! isset( $screen->id ) ) { 1157 return; 1158 } 1159 1140 1160 $page = $screen->id; 1141 1161 1142 1162 if ( !isset($wp_meta_boxes) )