Ticket #15000: 15000.6-refresh-2.diff
File 15000.6-refresh-2.diff, 3.2 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/template-functions.php
857 857 * @param string $title Title of the meta box. 858 858 * @param callable $callback Function that fills the box with the desired content. 859 859 * The function should echo its output. 860 * @param string| WP_Screen $screenOptional. The screen on which to show the box (like a post860 * @param string|array|WP_Screen $screen Optional. The screen on which to show the box (like a post 861 861 * type, 'link', or 'comment'). Default is the current screen. 862 * Also accepts an array of post type slugs. 862 863 * @param string $context Optional. The context within the screen where the boxes 863 864 * should display. Available contexts vary from screen to 864 865 * screen. Post edit screen contexts include 'normal', 'side', … … 874 875 function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) { 875 876 global $wp_meta_boxes; 876 877 877 if ( empty( $screen ) ) 878 if ( empty( $screen ) ) { 878 879 $screen = get_current_screen(); 879 elseif ( is_string( $screen ) )880 } elseif ( is_string( $screen ) ) { 880 881 $screen = convert_to_screen( $screen ); 882 } elseif ( is_array( $screen ) ) { 883 foreach ( $screen as $single_screen ) { 884 add_meta_box( $id, $title, $callback, $single_screen, $context, $priority, $callback_args ); 885 } 886 } 881 887 888 if ( ! isset( $screen->id ) ) { 889 return; 890 } 891 882 892 $page = $screen->id; 883 893 884 894 if ( !isset($wp_meta_boxes) ) … … 1017 1027 * 1018 1028 * @global array $wp_meta_boxes 1019 1029 * 1020 * @param string $id String for use in the 'id' attribute of tags. 1021 * @param string|object $screen The screen on which to show the box (post, page, link). 1022 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 1030 * @param string $id String for use in the 'id' attribute of tags. 1031 * @param string|array|object $screen The screen on which to show the box (post, page, link). Also accepts an 1032 * array of post type slugs from which to remove the box from. 1033 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 1023 1034 */ 1024 function remove_meta_box( $id, $screen, $context) {1035 function remove_meta_box( $id, $screen, $context ) { 1025 1036 global $wp_meta_boxes; 1026 1037 1027 if ( empty( $screen ) ) 1038 if ( empty( $screen ) ) { 1028 1039 $screen = get_current_screen(); 1029 elseif ( is_string( $screen ) )1040 } elseif ( is_string( $screen ) ) { 1030 1041 $screen = convert_to_screen( $screen ); 1042 } elseif ( is_array( $screen ) ) { 1043 foreach ( $screen as $single_screen ) { 1044 remove_meta_box( $id, $single_screen, $context ); 1045 } 1046 } 1031 1047 1048 if ( ! isset( $screen->id ) ) { 1049 return; 1050 } 1051 1032 1052 $page = $screen->id; 1033 1053 1034 1054 if ( !isset($wp_meta_boxes) )