Ticket #19131: 19131.3.diff
File 19131.3.diff, 2.2 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/screen.php
399 399 if ( is_a( $hook_name, 'WP_Screen' ) ) 400 400 return $hook_name; 401 401 402 $action = $post_type = $taxonomy = '';402 $action = $post_type = $taxonomy = null; 403 403 $is_network = $is_user = false; 404 404 405 405 if ( $hook_name ) … … 447 447 448 448 // If this is the current screen, see if we can be more accurate for post types and taxonomies. 449 449 if ( ! $hook_name ) { 450 if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ))451 $post_type = $_REQUEST['post_type'];452 if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ))453 $taxonomy = $_REQUEST['taxonomy'];450 if ( isset( $_REQUEST['post_type'] ) ) 451 $post_type = post_type_exists( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : false; 452 if ( isset( $_REQUEST['taxonomy'] ) ) 453 $taxonomy = taxonomy_exists( $_REQUEST['taxonomy'] ) ? $_REQUEST['taxonomy'] : false; 454 454 455 455 switch ( $base ) { 456 456 case 'post' : … … 468 468 } 469 469 break; 470 470 case 'edit-tags' : 471 if ( !$post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) )471 if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) ) 472 472 $post_type = 'post'; 473 473 break; 474 474 } … … 476 476 477 477 switch ( $base ) { 478 478 case 'post' : 479 if ( !$post_type )479 if ( null === $post_type ) 480 480 $post_type = 'post'; 481 481 $id = $post_type; 482 482 break; 483 483 case 'edit' : 484 if ( !$post_type )484 if ( null === $post_type ) 485 485 $post_type = 'post'; 486 486 $id .= '-' . $post_type; 487 487 break; 488 488 case 'edit-tags' : 489 if ( !$taxonomy )489 if ( null === $taxonomy ) 490 490 $taxonomy = 'post_tag'; 491 491 $id = 'edit-' . $taxonomy; 492 492 break; … … 511 511 512 512 $screen->base = $base; 513 513 $screen->action = $action; 514 $screen->post_type = $post_type;515 $screen->taxonomy = $taxonomy;514 $screen->post_type = (string) $post_type; 515 $screen->taxonomy = (string) $taxonomy; 516 516 $screen->is_user = $is_user; 517 517 $screen->is_network = $is_network; 518 518