Ticket #15000: 15000.6.diff
File 15000.6.diff, 2.6 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/template.php
900 900 * @param string $title Title of the meta box. 901 901 * @param callback $callback Function that fills the box with the desired content. 902 902 * The function should echo its output. 903 * @param string|WP_Screen $screenOptional. The screen on which to show the box (like a post903 * @param string|WP_Screen|array $screen Optional. The screen on which to show the box (like a post 904 904 * type, 'link', or 'comment'). Default is the current screen. 905 * Also accepts an array of post type slugs. 905 906 * @param string $context Optional. The context within the screen where the boxes 906 907 * should display. Available contexts vary from screen to 907 908 * screen. Post edit screen contexts include 'normal', 'side', … … 921 922 $screen = get_current_screen(); 922 923 elseif ( is_string( $screen ) ) 923 924 $screen = convert_to_screen( $screen ); 925 elseif ( is_array( $screen ) ){ 926 foreach ( $screen as $single_screen ){ 927 add_meta_box( $id, $title, $callback, $single_screen, $context, $priority, $callback_args ); 928 } 929 if( !isset( $screen->id ) ) 930 return; 931 } 924 932 925 933 $page = $screen->id; 926 934 927 935 if ( !isset($wp_meta_boxes) ) 928 936 $wp_meta_boxes = array(); … … 1052 1060 * @since 2.6.0 1053 1061 * 1054 1062 * @param string $id String for use in the 'id' attribute of tags. 1055 * @param string|object $screen The screen on which to show the box (post, page, link).1063 * @param string|object|array $screen The screen on which to remove the box from (post, page, link). Also accepts an array of post type slugs from which to remove the box from. 1056 1064 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 1057 1065 */ 1058 1066 function remove_meta_box($id, $screen, $context) { … … 1062 1070 $screen = get_current_screen(); 1063 1071 elseif ( is_string( $screen ) ) 1064 1072 $screen = convert_to_screen( $screen ); 1073 elseif ( is_array( $screen ) ){ 1074 foreach ( $screen as $single_screen ){ 1075 remove_meta_box( $id, $single_screen, $context ); 1076 } 1077 if( !isset( $screen->id ) ) 1078 return; 1079 } 1065 1080 1066 1081 $page = $screen->id; 1067 1082