Ticket #19080: 19080.diff
File 19080.diff, 2.4 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/template.php
849 849 if ( empty( $screen ) ) 850 850 $screen = get_current_screen(); 851 851 elseif ( is_string( $screen ) ) 852 $screen = convert_to_screen( $screen );852 $screen = WP_Screen::for_meta_box( $screen ); 853 853 854 854 $page = $screen->id; 855 855 … … 918 918 if ( empty( $screen ) ) 919 919 $screen = get_current_screen(); 920 920 elseif ( is_string( $screen ) ) 921 $screen = convert_to_screen( $screen );921 $screen = WP_Screen::for_meta_box( $screen ); 922 922 923 923 $page = $screen->id; 924 924 … … 984 984 if ( empty( $screen ) ) 985 985 $screen = get_current_screen(); 986 986 elseif ( is_string( $screen ) ) 987 $screen = convert_to_screen( $screen );987 $screen = WP_Screen::for_meta_box( $screen ); 988 988 989 989 $page = $screen->id; 990 990 -
wp-admin/includes/screen.php
52 52 global $wp_meta_boxes; 53 53 54 54 if ( is_string( $screen ) ) 55 $screen = convert_to_screen( $screen );55 $screen = WP_Screen::for_meta_box( $screen ); 56 56 57 57 if ( empty($wp_meta_boxes[$screen->id]) ) 58 58 return; … … 86 86 */ 87 87 function get_hidden_meta_boxes( $screen ) { 88 88 if ( is_string( $screen ) ) 89 $screen = convert_to_screen( $screen );89 $screen = WP_Screen::for_meta_box( $screen ); 90 90 91 91 $hidden = get_user_option( "metaboxhidden_{$screen->id}" ); 92 92 … … 498 498 $base .= '-user'; 499 499 } 500 500 501 if ( isset( self::$_registry[ $id ] ) ) 502 return self::$_registry[ $id ]; 501 if ( isset( self::$_registry[ $id ] ) ) { 502 $screen = self::$_registry[ $id ]; 503 if ( $screen === get_current_screen() ) 504 return $screen; 505 } else { 506 $screen = new WP_Screen(); 507 $screen->id = $id; 508 } 503 509 504 $screen = new WP_Screen();505 $screen->id = $id;506 510 $screen->base = $base; 507 511 $screen->action = $action; 508 512 $screen->post_type = $post_type; … … 515 519 return $screen; 516 520 } 517 521 522 static function for_meta_box( $meta_box ) { 523 if ( post_type_exists( $meta_box ) ) 524 return WP_Screen::get( 'post-' . $meta_box ); 525 else 526 return WP_Screen::get( $meta_box ); 527 } 528 518 529 /** 519 530 * Makes the screen object the current screen. 520 531 *